Metadata-Version: 2.1
Name: openapi-elm-client
Version: 0.3.3
Summary: Elm client generator for OpenAPI specifications
Home-page: http://github.com/abingham/openapi-elm-client
Author: Austin Bingham
Author-email: austin.bingham@gmail.com
License: MIT
Platform: any
Classifier: Development Status :: 3 - Alpha
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Dist: click
Requires-Dist: swagger-to
Provides-Extra: dev
Requires-Dist: black ; extra == 'dev'
Requires-Dist: bumpversion ; extra == 'dev'
Provides-Extra: test
Requires-Dist: godkjenn (<5,>=4) ; extra == 'test'
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: flake8 ; extra == 'test'

==================
openapi_elm_client
==================

`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 <https://bitbucket.org/sixty-north/godkjenn/src/master/>`_ 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.

