We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usecase: Where I have a legacy swagger.json. And now I just want to add new paths/def using swagger-merger instead of editing old file.
swagger.json
swagger-merger
Example:
// apis.swagger.json { "swagger": "2.0", "info": { "version": "1.0.0", "title": "Echo", "description": "#### Echos back every URL, method, parameter and header\nFeel free to make a path or an operation and use **Try Operation** to test it. The echo server will\nrender back everything.\n" }, "schemes": [ "http" ], "$ref": "./host.yaml", "basePath": "/echo", "paths": { "/": { "get": { "responses": { "$ref": "./responses.json#/components/root/get" } }, "post": { "responses": { "$ref": "./responses.json#/components/root/post" }, "parameters": [ { "$ref": "./name.json" }, { "$ref": "./year.json" } ] } } } }
// index.json { "$ref": "apis.swagger.json", "paths": { "/test-path/{id}": { "parameters": [ { "$ref": "./id.json" } ], "get": { "responses": { "$ref": "./responses.json#/components/test-path" } } } } }
Expected:
{ "swagger": "2.0", "info": { "version": "1.0.0", "title": "Echo", "description": "#### Echos back every URL, method, parameter and header\nFeel free to make a path or an operation and use **Try Operation** to test it. The echo server will\nrender back everything.\n" }, "schemes": [ "http" ], "$ref": "./host.yaml", "basePath": "/echo", "paths": { "/": { "get": { "responses": { "$ref": "./responses.json#/components/root/get" } }, "post": { "responses": { "$ref": "./responses.json#/components/root/post" }, "parameters": [ { "$ref": "./name.json" }, { "$ref": "./year.json" } ] } }, "/test-path/{id}": { "parameters": [ { "$ref": "./id.json" } ], "get": { "responses": { "$ref": "./responses.json#/components/test-path" } } } } }
Is there anyway to achieve this?
The text was updated successfully, but these errors were encountered:
Get your Expected through the following index.json:
index.json
{ "$ref": "apis.swagger.json", "paths": { "$ref#paths": "apis.swagger.json#paths", "/test-path/{id}": { "parameters": [ { "$ref": "./id.json" } ], "get": { "responses": { "$ref": "./responses.json#/components/test-path" } } } } }
Sorry, something went wrong.
I noticed the problem was using the / symbol, I'll take the time to upgrade, thanks for the feedback!
/
No branches or pull requests
Usecase: Where I have a legacy
swagger.json
. And now I just want to add new paths/def usingswagger-merger
instead of editing old file.Example:
Expected:
Is there anyway to achieve this?
The text was updated successfully, but these errors were encountered: