We’ve just released version 17.3 of Oracle REST Data Services – as an Early Adopter (BETA).
There are 2 major new features, and this post is about one of those: Swagger/OpenAPI style JSON for /metadata_catalog/ calls.
Wait, why should I care about REST?
The Movie
Screenshots for Those that Can’t do YouTube at Work
It’s fairly simple. Navigate to the /metadata-catalog/ URI for your RESTful Service.
Then copy this {…JSON…} over to something like Swagger.IO.
Once you paste it, say ‘Cancel’ on the popup dialog if you don’t want the JSON convereted to YAML – it’s up to you really.
Then start using the Swagger page.
But this isn’t just for looks – it’s also a REST Client!
Fill out your POST Body JSON stuff, hit Execute, and see what happens 🙂
Also note it happily gives you a CURL command you can use too!
Why Should I Care about REST?
I’m so happy you asked.
Go read this post in the current issue of UKOUG Scene.
4 Comments
Hi Jeff, This is cool, but is there a way I can generate swagger spec for all of the REST API definitions that I created using my procs and functions in SQL Dev using ORDS?
Thanks,
Poorni
How do you mean? Hit the /metadata-catalog/ endpoint for each Module you need the swagger for.
By how I mean – The /metadata-catalog and /open-api-catalog are coming up for my REST enabled tables. But for the REST modules, these URLs are giving me a 404 error!
@Poorni I had the same issue but it got fixed when I followed the correct routing patterns as described here. I was for example using {} instead of :
See: http://download.oracle.com/otndocs/java/javadocs/3.0/plugin-api/route-patterns.html
Also enable debugging in defaults.xml – helped me diagnose the problem,
true
true
Hope this helps.