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
- Host: GitHub
- URL: https://github.com/nickheap2/add-props-flipflop
- Owner: NickHeap2
- License: mit
- Created: 2021-12-30T15:18:16.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-18T08:25:52.000Z (over 2 years ago)
- Last Synced: 2025-04-12T07:14:16.178Z (about 1 year ago)
- Topics: openapi, openapi-spec, openapi-specification
- Language: JavaScript
- Homepage:
- Size: 39.1 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```