Build beautiful and interactive API documentation for ORDS
In this blog post, I will show you how to quickly build beautiful and interactive API documentation for your Oracle APEX REST data sources using swagger hub. Using APEX v23.1.
I downloaded the titanic data set and loaded them into tables in my APEX instance, created some authorized restful services and published them using swagger hub.
You can create a free account on swagger hub. Check out my titanic swagger hub here;
Press Authorize. Username REST, password Glasgow123!
I won't go through creating RESTful services and just show you the four I created that sit on top of the titanic data set;
The GET is a very simple SQL query;
select * from TITANIC_DATA_SET_NEW
A handy tip is to add comments, as there will appear on swagger hub, making your API self documenting;
Once you have created your modules, press the Generate Swagger Doc button;
This will generate an open API for you. Copy the API and paste it into swagger hub
This will generate the documentation;
As mentioned before, the comments you add in APEX will appear in the API, self documenting!
Same for any parameters you create, these are comments I created in APEX for the parameters. Male or female, giving the API user some info on what is required for this parameter;
The real power of swagger hub is it builds client libraries and documentation for your API. Press Export on the top right of the swagger hub page;
Comments
Post a Comment