Haskell types for OpenAPI 3.0.0.
Available as a Hackage package: openapi-typed.
The types follow the following opinonated conventions and deviations from the standards:
- Each OpenAPI object represented as
dataprovides the following:- Docstring showing how the constructor works
- Constructor with fields named using the convention
_<data>_field - Derivation of
Eqfor each data class - Derivation of
Showfor each data class - Derivation of
ToJSONfor each data class - Derivation of
FromJSONfor each data class - Getter for each field using the convention
get<data><field>, where the field is capitalized, iegetPathItemSummary - Setter for each field using the convention
set<data><field>, where the field is capitalized, iesetPathItemSummary 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.
- Clone this repository:
git clone https://github.com/meeshkan/openapi-typed.git - Move into the directory:
cd openapi-typed - Set up your local environment: You can use this guide from The Haskell Tool Stack for reference
The tests show how to use this library to parse the Slack and Stripe OpenAPI specs.
To execute the tests, run:
stack testNotice a bug? Interested in contributing? The best way to get involved is to open an issue.
Please note that this project is governed by the Meeshkan Community Code of Conduct. By participating, you agree to abide by its terms.
At Meeshkan, we're working to improve how people test their products. So if you have feelings about this package, we want to hear from you.
Here are some ways you can get in touch:
