Elm client generator for OpenAPI specifications
Project description
openapi-elm-client generates Elm client code from OpenAPI 2.0 specification.
Usage
Basic usage is like this:
openapi-elm-client my_spec.yaml Some.Module.Name
This will read the OpenAPI spec from my_spec.yaml and create an Elm module named Some.Module.Name. This writes the output to stdout, so a more typical invocation might be:
openapi-elm-client my_spec.yaml Some.Module.Name > src/Some/Module/Name.elm
Generated code
openapi-elm-client produces a named type alias for each definition in the input spec. It also produces a function for calling each endpoint defined in the spec, along with appropriate JSON encoders and decoders.
Tests
You can run the tests by first installing the test dependencies:
pip install ".[test]"
and then invoking pytest:
pytest tests
Approval tests
openapi-elm-client uses godkjenn for approval testing. We have collection of input specs along with “approved” versions of the code generated by openapi-elm-client; if the generated code ever changes, we have to see if it’s still correct.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for openapi_elm_client-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1c8df21d3359a262ca1b3b4ab8240ed1f018b5f855715fef60c47c7f36a7b53 |
|
MD5 | 4c9e8230556e8c6eb6ed520513c5b4ca |
|
BLAKE2b-256 | 6323626f8c135773f13e0e9bf2209517f1222848b0d24b1625dd95505ad26b87 |