Swagger elm generates types and decoders from Swagger document.
Note: This project is currently under active and initial development. Thus everything is not finished and there's no guarantee that anything will work as promised. However I'm happy for any testing and feedback I can get.
npm install ahultgren/swagger-elm -g
- Optionally install elm format
Using elm-format:
cat swagger.json | swagger-to-elm | elm-format --stdin
Unformatted (no guarantee it will work):
cat swagger.json | swagger-to-elm
Help and feedback would be gladly appreciated, but please just drop me a line (an issue) before you start, to prevent wasted effort.
- Basic decoding of all types (Integer, Float, String, Boolean, Object, Array, Null)
-
$ref
s - Enum for strings
- Other types (if meaningful)
- Default values for Integer, Float, String, Boolean
- Complex types (if meaningful)
- Sanitization of identifiers
- Unit tests
- Dicts (additionalProperties)
- Recursive types and decoders
- Encoders
- Polymorphism (allOf and discriminator)
- Formats? (datetime, uuid, etc)
- Deduplication of types and fields
ISC