Description
Types for OpenAPI.
Description
Please see the README on GitHub at https://github.com/meeshkan/openapi-haskell#readme
README.md
openapi-typed
Haskell types for OpenAPI 3.0.0. The types follow the following opinonated conventions and deviations from the standards:
- For each OpenAPI object represented as
data, provides the following:- a docstring showing how the constructor works
- a constructor with fields named using the convention
_<data>_field - a derivation of
Eqfor each data class - a derivation of
Showfor each data class - a derivation of
ToJSONfor each data class - a derivation of
FromJSONfor each data class - a getter for each field using the convention
get<data><field>, where the field is capitalized, iegetPathItemSummary - a setter for each field using the convention
set<data><field>, where the field is capitalized, iesetPathItemSummary - an
eitherfunction for all datatypes with multiple construtors that take a single argument using the conventioneither<data><constructor>, ieeitherReferenceOrRef
- Adds the possibility to use
x-extensions on almost all objects, as this happens a lot in the wild. - Changes the
itemstype in shema to accept a tuple in addition to a schema and a reference.
The Hackage package is in openapi-typed. The tests show how to use this library to parse the Slack and Stripe OpenAPI specs.