mirror of
https://github.com/NorfairKing/autodocodec.git
synced 2024-11-30 13:22:46 +03:00
self(auto)- documenting encoders and decoders
.github | ||
autodocodec | ||
autodocodec-aeson | ||
autodocodec-aeson-schema | ||
autodocodec-api-usage | ||
autodocodec-swagger2 | ||
autodocodec-yaml | ||
nix | ||
.gitignore | ||
.hlint.yaml | ||
ci.nix | ||
default.nix | ||
LICENSE | ||
README.md | ||
shell.nix | ||
stack.yaml |
Autodocodec
Autodocodec is short for "self(auto)- documenting encoder and decoder".
In short: You write one (1) instance, of the 'Codec' type-class, for your type, and you get:
- A 'ToJSON' instance from 'aeson'
- A 'FromJSON' instance from 'aeson'
- A json schema
- A human-readable yaml schema
- Hopefully soon also: A swagger schema
- Hopefully soon also: An openapi schema
- Potentially also: bson instances for mongodb
DISCLAIMER: This is a work in progress.
This is not ready for production, it is not in use in any of my own projects yet, I do not recommend using it yet.
- Documentation is not complete.
- Some pieces of the implementation
Goals:
- Correct-by-construction encoding and decoding, without generating code.
- Generate automatically-correct documentation from code.
- Fun but not important: Be able to provide instances without depending on aeson and/or yaml.
- Would be nice: support for recursive types.
Fully featured example
TODO