Discussions
Categories
- 196.7K All Categories
- 2.2K Data
- 235 Big Data Appliance
- 1.9K Data Science
- 449.8K Databases
- 221.5K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 549 MySQL Community Space
- 477 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3K ORDS, SODA & JSON in the Database
- 532 SQLcl
- 4K SQL Developer Data Modeler
- 186.8K SQL & PL/SQL
- 21.3K SQL Developer
- 295.4K Development
- 17 Developer Projects
- 138 Programming Languages
- 292.1K Development Tools
- 104 DevOps
- 3.1K QA/Testing
- 645.9K Java
- 27 Java Learning Subscription
- 37K Database Connectivity
- 153 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.1K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 17 Java Essentials
- 158 Java 8 Questions
- 85.9K Java Programming
- 79 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.2K Java SE
- 13.8K Java Security
- 203 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 392 LiveLabs
- 37 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.6K Other Languages
- 2.3K Chinese
- 170 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 230 Portuguese
ORDS PL/SQL AutoREST - incomplete OpenAPI def

Hi,
It seems that openapi definition for autorest plsql objects (tried both standalone proc and plsql package) doesn't contain definition for input parameters.
Tested on ORDS 22.1.0.105.1723
For example:
create or replace PROCEDURE TEST_PROC (P1 IN VARCHAR2, P2 IN NUMBER)
ORDS OpenAPI definition:
{ "swagger": "2.0", "info": { "title": "ORDS generated API for TEST_PROC", "version": "1.0.0" }, "host": "192.168.213.237:35000", "basePath": "/ords/kdario/test_proc", "schemes": [ "http" ], "produces": [ "application/json" ], "paths": { "/": { "post": { "description": "Create a new record on TEST_PROC", "produces": [ "application/json" ], "responses": { "201": { "description": "The successfully created record.", "schema": { "type": "object", "properties": {} } } } } } } }
Also, generated api description is misleading: "Create a new record on TEST_PROC".
Is this some bug/regression or OpenAPI is not fully supported for autorest plsql api?
Regards,
Dario
Answers
-
Looks like you've got two bugs there. Let me confirm and file those for you.
-
Note that Open API definition for manually created ORDS module also has some issues.
For example:
CREATE OR REPLACE PROCEDURE TEST_PROC2 (P1 IN VARCHAR2, P2 IN INTEGER, P3 IN NUMBER, P4 IN DATE, P5 IN CLOB)
POST handler:
begin test_proc2(:p_varchar, :p_int, :p_number, :p_date, :p_clob); end;
ORDS Open API definition:
{ "swagger": "2.0", "info": { "title": "ORDS generated API for testmodule", "description": "My first module", "version": "1.0.0" }, "host": "192.168.213.237:35000", "basePath": "/ords/kdario/testmodule", "schemes": [ "http" ], "produces": [ "application/json" ], "paths": { "/testproc": { "post": { "description": "My first handler", "responses": { "201": { "description": "The successfully created record.", "schema": { "type": "object", "properties": {} } } }, "parameters": [ { "name": "payload", "in": "body", "required": true, "schema": { "$ref": "#/definitions/testmodule_ITEM" } } ] } } }, "definitions": { "STRING": { "type": "string" }, "testmodule_ITEM": { "properties": { "p_clob": { "type": "string" }, "p_date": { "type": "string" }, "p_int": { "type": "string" }, "p_number": { "type": "string" }, "p_varchar": { "type": "string" } } } } }
- definition for p_int and p_number has incorrect type
- open api parameter order doesn't follow parameter order in stored procedure
- description says "The successfully created record."
Also tried to test stored procedure with boolean and blob input parameters, but could not make it work, the error is: PLS-00306: wrong number or types of arguments in call to 'TEST_PROC2'.
I'm not sure if this is another bug or section about type mappings is not up to date: https://docs.oracle.com/en/database/oracle/oracle-rest-data-services/22.1/orddg/ords-database-type-mappings.html#GUID-4F7FA58A-1C29-4B7E-819F-21DB4B68FFE1
Thanks