4 Replies Latest reply on Mar 2, 2019 1:34 AM by thatJeffSmith-Oracle

    ORDS Doesn't generate CRUD

    Joe the Jet

      Using ORDS version 18.4.0.r3541002

       

      Sql Dev version is  18.1.0.095    

       

      I right-click and "enable rest services"

       

      I believe this is supposed to generate all the CRUD code right? At least that's what it seems from Jeff's video: https://www.youtube.com/watch?v=rvxTbTuUm5k

       

      How do I get this code generated. Seems that there is a non-obvious trick?

       

      All I get is

       

       

       

       

       

      name"HEROES"
      primarykey
      0"id"
      members
      0
      name"id"
      type"NUMBER"
      1
      name"name"
      type"VARCHAR2"
      links
      0
      rel"collection"
      href"http://ops-9405125:9090/ords/trex/metadata-catalog/"
      mediaType"application/json"
      1
      rel"canonical"
      href"http://ops-9405125:9090/ords/trex/metadata-catalog/heroes/"
      mediaType"application/json"
      2
      rel"alternate"
      href"http://ops-9405125:9090/ords/trex/open-api-catalog/heroes/"
      mediaType"application/openapi+json"
      3
      rel"describes"
      href"http://ops-9405125:9090/ords/trex/heroes/"

       

        • 1. Re: ORDS Doesn't generate CRUD
          Joe the Jet

          Ok, it appears that metadata-catalog doesn't show that info, but the open-api-catalog does

           

          {"swagger":"2.0","info":{"title":"ORDS generated API for HEROES","version":"1.0.0"},"host":"gendbracdev1:9090","basePath":"/ords/trex/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"}}},"PAYLOAD2":{"properties":{"NAME":{"$ref":"#/definitions/VARCHAR2"}}}}}

           

          So, evidently it *did* get generated. Just didn't know where to look.

          • 3. Re: ORDS Doesn't generate CRUD
            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. Any idea why or why adding the table after the api returns a blank page?

            • 4. Re: ORDS Doesn't generate CRUD
              thatJeffSmith-Oracle

              Please start a new thread