Updating an OpenAPI specification
Procedure
-
Open the Swagger JSON that you are planning to update.
- You can open it from HCL Commerce document here: HCL Commerce REST API.
- You can access the JSON file in HCL Commerce servers:
- Go to the Swagger Editor.
- Copy and paste the contents of the Swagger json into the Swagger Editor left-hand panel.
-
Make changes to the spec:
Note: You can use the Insert option to add path items, operation, info, external documentation, tag declaration, and tags to operation, servers and example responses.Note: Validation errors will appear in a notification at the top of the right-hand pane.
- When editing the JSON is finished, use a JSON validator to ensure its validity. Swagger Editor does not validate JSON linting support, so it's necessary to put it through a linter to validate. You can find JSON validators at: https://jsonlint.com/.
-
When editing the JSON is finished, copy and paste the contents back into the text editor
file.
Note: Avoid using the JSON option in Swagger Editor. This will create a JSON file using two spaces rather than four spaces for tab.