4 Replies Latest reply on Mar 4, 2019 6:29 PM by Joe the Jet

    open-api-catalog not generating swagger

    Joe the Jet

      Ok, sorry to bother you again, but I have been unable to get the open-api-catalog to return anything for a table and when I do it from a schema it no longer returns swagger, it returns this:

      http://server:9090/ords/trex/open-api-catalog/

       

      {"items":[{"name":"HEROES","links":[{"rel":"canonical","href":"http://serva.llnl.gov:9090/ords/trex/open-api-catalog/heroes/","mediaType":"application/openapi+json"}]},{"name":"hw","links":[{"rel":"canonical","href":"http://serva.llnl.gov:9090/ords/trex/open-api-catalog/hw/","mediaType":"application/openapi+json"}]},{"name":"TRVL_ACCR_SYS_PARM","links":[{"rel":"canonical","href":"http://serva.llnl.gov:9090/ords/trex/open-api-catalog/accrsysparm/","mediaType":"application/openapi+json"}]}],"hasMore":false,"limit":25,"offset":0,"count":3,"links":[{"rel":"self","href":"http://serva.llnl.gov:9090/ords/trex/open-api-catalog/"},{"rel":"first","href":"http://serva.llnl.gov:9090/ords/trex/open-api-catalog/"}]}

       

       

      It used to return swagger, but it stopped. Also, any idea why or why adding the table after the api returns a blank page?

        • 1. Re: open-api-catalog not generating swagger
          thatJeffSmith-Oracle

          can you share version of db and ords?

           

          can you share ddl for your table?

          • 2. Re: open-api-catalog not generating swagger
            Joe the Jet

            DB = 12.1.0.2.0

            ORDS = 18.4.0.r3541002

             

            CREATE TABLE heroes

                (id                             NUMBER NOT NULL,

                name                           VARCHAR2(100 BYTE) NOT NULL,

                ora_ins_by                     VARCHAR2(100 BYTE))

              SEGMENT CREATION IMMEDIATE

              NOPARALLEL

              LOGGING

              MONITORING

            /

             

             

             

             

             

            -- Constraints for HEROES

             

            ALTER TABLE heroes

            ADD CONSTRAINT heroes_pk PRIMARY KEY (id)

            USING INDEX

            /

             

             

            -- Triggers for HEROES

             

            CREATE OR REPLACE TRIGGER heroes_bir

            BEFORE

              INSERT

            ON heroes

            REFERENCING NEW AS NEW OLD AS OLD

            FOR EACH ROW

            BEGIN

                SELECT trex_cnfr_intr_no_seq.NEXTVAL INTO :new.id FROM DUAL;

               :NEW.ora_ins_by := USER;

            END;

            /

            • 3. Re: open-api-catalog not generating swagger
              thatJeffSmith-Oracle

              so http://localhost:8080/ords/hr/open-api-catalog/heroes/

               

              for me gives me this

               

              {"swagger": "2.0","info": {"title": "ORDS generated API for HEROES","version": "1.0.0"},"host": "localhost:8080","basePath": "/ords/hr/heroes","schemes": ["http"],"produces": ["application/json"],"paths": {"/": {"get": {"description": null,"produces": ["application/json"],"responses": {"200": {"description": "output of the endpoint","schema": {"type": "object","properties": {}}}}},"post": {"description": null,"produces": ["application/json"],"responses": {"200": {"description": "output of the endpoint","schema": {"type": "object","properties": {}}}},"parameters": [{"name": "payload","in": "body","required": true,"schema": {"$ref": "#/definitions/PAYLOAD1"}}]}},"/{id}": {"get": {"description": null,"produces": ["application/json"],"responses": {"200": {"description": "output of the endpoint","schema": {"type": "object","properties": {}}}},"parameters": [{"name": "id","in": "path","required": true,"type": "string","description": "implicit","pattern": "^[^/]+$"}]},"put": {"description": null,"produces": ["application/json"],"responses": {"200": {"description": "output of the endpoint","schema": {"type": "object","properties": {}}}},"parameters": [{"name": "id","in": "path","required": true,"type": "string","description": "implicit","pattern": "^[^/]+$"},{"name": "payload","in": "body","required": true,"schema": {"$ref": "#/definitions/PAYLOAD2"}}]},"delete": {"description": null,"produces": ["application/json"],"responses": {"200": {"description": "output of the endpoint","schema": {"type": "object","properties": {}}}},"parameters": [{"name": "id","in": "path","required": true,"type": "string","description": "implicit","pattern": "^[^/]+$"}]}}},"definitions": {"NUMBER": {"type": "number"},"VARCHAR2": {"type": "string"},"PAYLOAD1": {"properties": {"ID": {"$ref": "#/definitions/NUMBER"},"NAME": {"$ref": "#/definitions/VARCHAR2"},"ORA_INS_BY": {"$ref": "#/definitions/VARCHAR2"}}},"PAYLOAD2": {"properties": {"NAME": {"$ref": "#/definitions/VARCHAR2"},"ORA_INS_BY": {"$ref": "#/definitions/VARCHAR2"}}}}}

              • 4. Re: open-api-catalog not generating swagger
                Joe the Jet

                Ah jeez, I forgot the stupid slash at the end again. My bad. Ok, that works now. Sorry about that.

                 

                But, shouldn't "https://community.oracle.com/ " return swagger also? I get what I show above. Is taht what is expected?