Document the REST interface (optional)
Now that you have tested the API, you can provide it to clients or developers who will use it to build an online store. When you provide REST interfaces to developers, you should provide documentation so that they know how to call the interfaces.
You can use the Open API Spec to document REST interfaces and a tool, such as Swagger, to edit and format the documentation. InterSystems IRIS contains a feature in API Management that generates the document framework for your REST APIs. You still need to edit the generated documentation to add comments and additional information, such as content of arguments and HTTP return values.
To generate the documentation for the coffeemakerapp REST sample, enter the following REST call, using the information specific to your InterSystems IRIS instance and the name of the namespace you created:
- HTTP Action:
GET
- URL:
http://localhost:52773/api/mgmnt/v1/INTEROP/spec/rest/coffeemakerapp/
- Basic Auth: tech demo7
You can paste the response from this call into Swagger, a tool for API specifications. It converts the JSON to YAML (Yet Another Markup Language) and displays the documentation. You can use the Swagger editor to add more information. It displays each available endpoint and the expected parameters. In your VM, you can open Chrome, go to swagger.io, and try Swagger for free.
