Build beautiful and interactive API documentation for ORDS

Image
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 b

Oracle APEX Change Textarea maximum length (and placeholder) dynamically

The requirement is to change the maximum size of a text area dynamically depending on the type of user that has logged in.

Its a standard Textarea;


With a placeholder stating the input should be no more than 1750 characters;


Which looks like this
If the user is of type 'A' which is stored in a P0 item P0_TY_TYPE (calculated when the user logs in) we need to change the maximum characters for this Textarea to 1500.  This can be accomplished with some JavaScript in Execute when page loads;

if ($v( "P0_TY_TYPE" ) == 'A')
{
    $('#P8_ESTEEM').attr('placeholder','This statement should be no more than 200 words (approx 1500 characters)');
    $("#P8_ESTEEM").attr('maxlength','1500');    
    $("#P8_ESTEEM_CHAR_COUNT > span.apex-item-textarea-counter--size").text("1500");
}


Comments

Popular posts from this blog

Oracle APEX Interactive Grid colour cells based on a condition using JavaScript and CSS

Oracle APEX pretty checkbox item plugin

Build beautiful and interactive API documentation for ORDS