Swagger Doc from APEX ORDS RESTful Workshop

Doug Gault APEX, ORDS, REST Leave a Comment

Last week Dietmar Aust tweeted about the APEX 18.1 ability to generate Swagger Doc from your ORDS based RESTful services. This is actually an innate ability within ORDS itself and is simply exposed through APEX. What may not have been obvious in EA2 was that there is also a new Instance setting under the REST section. The new setting takes a URL which points to a SWAGGER UI 2.0+ server.  If the instance setting is set, the URL that generates the web service’s swagger JSON document will be passed to the Swagger UI server. If a there is no URL specified, raw JSON will be produced.

Setting up the Swagger server is actually quite easy. It is a simple set of HTML, Javascript and CSS files that can be downloaded from here and unzipped into a directory into the web root of your local web server.

Then, when you’re in the ORDS REST Workshop, navigate to the module definition level and click the Generate Swagger Doc button.

 

 

If the Swagger UI URL is set correctly at the Instance level, APEX will forward the URL of your documentation to the Swagger UI Server. The server must be able to reach back to the documentation url, but as long as it can, you’ll not only get documentation but be able to test the services as well.

 

 

Hope this helps Dietmar in his APEXWorld2108 presentation!

Leave a Reply