In case you missed it, version 21.2 of ORDS was released last week.

If you peruse the ReadMe/Release Notes

BUG:32924934 – Database Actions: Third Party Library updates – uptake Swagger UI 3.45.1

What does that mean?

As you’re building your REST APIs, you’ll want to document them, but maybe also test them? And you can do this with GETs fairly easily, but what about POST, PUT, and DELETE?

We’ll you pull our cURL, of course.

But what if you want to try it right as you’re looking at it, in your browser?

I’ve just tested a DELETE handler in my ora_magazine REST API module to delete a record in my table.

So my module is very simple, one template and ONE handler – a DELETE. It’s tied to a SQL DELETE command. I have a record with ID 21 in my table…that is, I did before I tested the API.

So, how do we access this feature? Read on!

OpenAPI support in ORDS 21.2

When browsing your REST Modules, you’ll see –

The first item is what’s new for for version 21.2

The OpenAPI export will give you {json} description of the APIs that you can post into something like swagger.editor.io to generate a doc/client for the module.

In 21.2, we’ve just added that feature natively into the ORDS REST UI.

If you don’t see the OpenAPI View feature available, it’s because it’s not activate if the module is protected by a Priv/Role.

A Quick Demo

I’m feeling generous – everyone gets a 225% raise!

More complicated patterns, say POSTing the contents of a file in the Body might require you stepping back out to a REST client like POSTMAN (or Insomnia!) or using the generated cURL command to help you get started on building it out.

Final note on this topic – the feature is only available on (unsecured) REST Modules at the moment. Hopefully next release will include AUTOREST enabled objects as well.

Author

I'm a Distinguished Product Manager at Oracle. My mission is to help you and your company be more efficient with our database tools.

4 Comments

  1. Hi Jeff,

    I’mlooking forward to the next release because of auto rest swagger support.
    BTW is there any way to log request and response header and payload in standalone mode?

  2. Jeff,

    I would like to know more about ORDS support for UDT (nested table/objects) ? Is there automatic binding between Objectjson or we need to bind them manually using DBMS_JSON?

    • Give it a go and find out πŸ™‚

      Yes, NESTED TABLE as a column in your table is supported. We abstract that as an array by the name of the column.

Reply To Ozzy Cancel Reply