🇺🇸 English | 🇷🇺 Русский | 🇨🇳 中文
This example demonstrates the basic usage of openapi-modifier with JSON configuration for modifying OpenAPI specification.
example-cli-simple-json-config/
├── input/
│ └── openapi.yml # Input OpenAPI file
├── output/
│ └── openapi.yml # Modified OpenAPI file
├── openapi-modifier.config.json # Configuration file
└── package.json # npm dependencies file
The openapi-modifier.config.json file defines a simple configuration that removes all operationId from the API specification:
{
"pipeline": [
{
"rule": "remove-operation-id"
}
]
}- Install dependencies:
npm install- Run the modifier:
npm startor directly:
openapi-modifier --input=input/openapi.yml --output=output/openapi.yml --config=openapi-modifier.config.jsonAfter executing the command, a modified openapi.yml file will be created in the output directory, where all operationId will be removed from the API specification.
In the output file output/openapi.yml, all operationId will be removed while the rest of the API specification structure remains unchanged.