swagger-modifier
v1.2.9
Published
This tool modifies Swagger files by adding prefixes and suffixes to operation IDs and references.
Downloads
1,614
Readme
Swagger Modifier
This tool modifies Swagger files by adding prefixes and suffixes to operation IDs and references.
Installation
npm install -g swagger-modifier
Usage
swagger-modifier -i <inputFilePath> -o <outputFilePath> -c <configMapping>
Options:
-i, --input : Path to the input Swagger file. -o, --output : Path to the output directory. -c, --config : Path to the JSON file containing a map of operation IDs to prefixes and suffixes.
Example:
swagger-modifier -i swagger.json -o modified-swagger.json -c config.json
config.json:
{
"endpoints": [
{
"packageName": "users-create-service",
"path": "/users",
"method": "post",
"prefix": "USER_CREATE_",
"suffix": "_V1",
"inputSuffix": "_Input",
"ignore": [],
"openapi-config": {}
},
{
"packageName": "users-get-service",
"path": "/users",
"method": "get",
"prefix": "USER_GET_",
"suffix": "_V1",
"inputSuffix": "_Input",
"inputSuffix": "_Input",
"ignore": []
}
]
}
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
This project is licensed under the MIT License.