|
25 | 25 |
|
26 | 26 | ## Generate models from AsyncAPI documents |
27 | 27 |
|
| 28 | +When providing an AsyncAPI document, the library iterates the entire document and generate models for all defined messages. If any other kind of iteration is wanted, feel free to create a [feature request](https://github.com/asyncapi/modelina/issues/new?assignees=&labels=enhancement&template=enhancement.md). |
| 29 | + |
28 | 30 | There are two ways to generate models for an AsyncAPI document. |
29 | 31 |
|
30 | 32 | - [Generate from a parsed AsyncAPI document](../examples/asyncapi-from-parser) |
31 | 33 | - [Generate from a pure JS object](../examples/asyncapi-from-object) |
32 | 34 |
|
33 | 35 | The library expects the `asyncapi` property for the document to be set in order to understand the input format. |
34 | 36 |
|
| 37 | +The message payloads, since it is a JSON Schema variant, is [interpreted as a such](./interpretation_of_JSON_Schema.md). |
| 38 | + |
35 | 39 | ## Generate models from JSON Schema draft 7 documents |
36 | 40 |
|
37 | 41 | There are one way to generate models from a JSON Schema draft 7 document. |
38 | 42 |
|
39 | 43 | - [Generate from a pure JS object](../examples/json-schema-draft7-from-object) |
40 | 44 |
|
41 | | -The library expects the `$schema` property for the document to be set in order to understand the input format. By default, if no other inputs are detected, it defaults to `JSON Schema draft 7`. |
| 45 | +The library expects the `$schema` property for the document to be set in order to understand the input format. By default, if no other inputs are detected, it defaults to `JSON Schema draft 7`. The process of interpreting a JSON Schema to a model can be read [here](./interpretation_of_JSON_Schema.md). |
| 46 | + |
| 47 | +## Generate models from Swagger 2.0 documents |
| 48 | +When providing an AsyncAPI document, Modelina iterates the entire document and generate models for all defined `body` parameters and responses. If any other kind of iteration is wanted, feel free to create a [feature request](https://github.com/asyncapi/modelina/issues/new?assignees=&labels=enhancement&template=enhancement.md). |
| 49 | + |
| 50 | +There are one way to generate models from a Swagger 2.0 document |
| 51 | + |
| 52 | +- [Generate from a pure JS object](../examples/swagger2.0-from-object) |
| 53 | + |
| 54 | +The Swagger input processor expects that the property `swagger` is defined in order to know it should be processed. |
| 55 | + |
| 56 | +The response payload and `body` parameters, since it is a JSON Schema variant, is [interpreted as a such](./interpretation_of_JSON_Schema.md). |
| 57 | + |
42 | 58 |
|
43 | 59 | ## Generate Go models |
44 | 60 | TODO |
|
0 commit comments