An open API service indexing awesome lists of open source software.

https://github.com/themcaffee/json-to-yaml-schema

Convert JSON responses into YAML OpenAPI Schemas
https://github.com/themcaffee/json-to-yaml-schema

Last synced: 3 months ago
JSON representation

Convert JSON responses into YAML OpenAPI Schemas

Awesome Lists containing this project

README

          

# JSON to YAML OpenAPI Schema

Converts response JSON into an appropriate OpenAPI Schema in the YAML format.

## Examples

#### Object

```
python main.py '{"fname": "bobby", "lname": "tables"}'
```

Output:

```
type: object
properties:
fname:
type: string
lname:
type: string
```

#### List

```
python main.py '[{"fname": "bobby", "lname": "tables"}]'
```

Output:

```
type: array
items:
type: object
properties:
fname:
type: string
lname:
type: string
```