|
3 | 3 | Code generator that ingest a OpenAPI Specification and writes the structs that represent resources of that given specification and also builds the client based on the paths. |
4 | 4 |
|
5 | 5 | Currently supports two types of generation: |
6 | | -* Tesla - Generates a module with a Tesla client |
7 | | -* Req - Generates a module using Req |
| 6 | + |
| 7 | +* [Tesla](https://hexdocs.pm/tesla/readme.html) - Generates a module with a Tesla client. |
| 8 | +* [Req](https://hexdocs.pm/req/readme.html) - Generates a module using Req. |
8 | 9 |
|
9 | 10 | By default we're using Jason for encoding and decoding of strucs |
10 | 11 |
|
11 | 12 | Does not require you to install extra dependencies as we're using |
12 | 13 |
|
13 | 14 | ## Roadmap |
14 | | -[] - Support XML specification parsing |
15 | | -[] - Support Inheritance and Polymorphism |
16 | | -[] - Add typespecs to generated Strucs |
17 | | -[] - Add typespecs to Client |
18 | | -[] - Generate tests for Client |
| 15 | + |
| 16 | +- [] Support YAML specification parsing |
| 17 | +- [] Support Inheritance and Polymorphism |
| 18 | +- [] Add typespecs to generated Strucs |
| 19 | +- [] Add typespecs to Client |
| 20 | +- [] Generate tests for Client |
19 | 21 |
|
20 | 22 | ## Installation |
| 23 | + |
21 | 24 | Install it using: |
22 | | -``` |
| 25 | + |
| 26 | +```sh |
23 | 27 | mix do local.rebar --force, local.hex --force |
24 | 28 | mix escript.install hex openapi_codegen |
25 | 29 | ``` |
26 | 30 |
|
27 | 31 | ## Usage |
28 | 32 |
|
29 | 33 | Generating a Tesla client using PetStore example: |
| 34 | + |
30 | 35 | `openapi_codegen --tesla --output-path lib openapi_petstore.json` |
31 | 36 |
|
32 | 37 | Generating a Req client using PetStore example: |
| 38 | + |
33 | 39 | `openapi_codegen --req --output-path lib openapi_petstore.json` |
34 | 40 |
|
35 | 41 | This examples will generate your code in your folder `lib` and also create a `lib/components` with all the structs. |
|
0 commit comments