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

https://github.com/nickheap2/add-props-flipflop

Toggle additionalProperties in an OpenAPI spec
https://github.com/nickheap2/add-props-flipflop

openapi openapi-spec openapi-specification

Last synced: 10 months ago
JSON representation

Toggle additionalProperties in an OpenAPI spec

Awesome Lists containing this project

README

          

# add-props-flipflop
Toggle additionalProperties in an OpenAPI spec

## Usage

Use --help to get a list of options
``` text
Usage: add-props-flipflop [options]

Options:
-V, --version output the version number
-s, --source Source OpenAPI spec filename
-o, --output Output OpenAPI spec filename
-d, --dereferenced Write dereferenced source OpenAPI spec to this filename
-f, --flipto set additionalProperties to this value (choices: "true", "false")
-h, --help display help for command
```

Convert an OpenAPI spec with additionalProperties set to false
``` bash
add-props-flipflop --source openapi.yaml --output openapi-false.yaml --flipto false
```

Convert an OpenAPI spec with additionalProperties set to true
``` bash
add-props-flipflop --source openapi.yaml --output openapi-false.yaml --flipto true
```

Convert an OpenAPI spec with additionalProperties set to false and a copy of the dereferenced file before setting
``` bash
add-props-flipflop --source openapi.yaml --dereferenced openapi-deref.yaml --output openapi-false.yaml --flipto false
```