4 Replies Latest reply on Aug 22, 2019 7:32 PM by thatJeffSmith-Oracle

    Swagger JSON Parse Error

    Chad Boom

      When generating swagger output, we are getting a json parse error.  We just upgraded to ords 19.1.  Below is some supporting information.  Any help you can provide would be greatly appreciated.

       

      https://xxxxxxxxxx/open-api-catalog/inventory/

       

       

       

       

      {"swagger":"2.0","info":{"title":"ORDS generated API for Inventory Services","version":"1.0.0"},"host":"ords1dev.sficorp.com","basePath":"/ords/invio/xxords/inventory","schemes":["http"],"produces":["application/json"],"paths":{"/accountNumberList":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"userSessionId","in":"query","type":"string","description":"Implicit parameter"}]}},"/adjustunit":{"post":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"quantity","in":"header","type":"string","required":true},{"name":"reasonCode","in":"header","type":"string","required":true},{"name":"secondaryQuantity","in":"header","type":"string","required":true},{"name":"unitId","in":"header","type":"string","required":true},{"name":"unitOfMeasure","in":"header","type":"string","required":true},{"name":"userSessionId","in":"header","type":"string","required":true}]}},"/combineUnits":{"post":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{"message":"status"
      Error: Parse error on line 1: ...:{"message":"status":}}}},"parameters":[ -----------------------^ Expecting 'EOF', '}', ',', ']'
      :}}}},"parameters":[{"name":"payload","in":"body","required":true,"schema":{"$ref":"#/definitions/PAYLOAD1"}}]}},"/createPalletTransaction":{"post":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"payload","in":"body","required":true,"schema":{"$ref":"#/definitions/PAYLOAD2"}}]}},"/createtestinventory":{"post":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{"message":"status":"unitList":}}}},"parameters":[{"name":"payload","in":"body","required":true,"schema":{"$ref":"#/definitions/PAYLOAD3"}}]}},"/dcsummarylist":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"export","in":"header","type":"string","required":true},{"name":"inventoryType","in":"header","type":"string","required":true},{"name":"locationFrom","in":"header","type":"string","required":true},{"name":"locationTo","in":"header","type":"string","required":true},{"name":"locationType","in":"header","type":"string","required":true},{"name":"userSessionId","in":"header","type":"string","required":true}]}},"/directputawaylist":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"export","in":"header","type":"string","required":true},{"name":"itemType","in":"header","type":"string","required":true},{"name":"rackAisleFrom","in":"header","type":"string","required":true},{"name":"rackAisleTo","in":"header","type":"string","required":true},{"name":"rackBinFrom","in":"header","type":"string","required":true},{"name":"rackBinTo","in":"header","type":"string","required":true},{"name":"rackLevelFrom","in":"header","type":"string","required":true},{"name":"rackLevelTo","in":"header","type":"string","required":true},{"name":"transactionDateFrom","in":"header","type":"string","required":true},{"name":"transactionDateTo","in":"header","type":"string","required":true},{"name":"userSessionId","in":"header","type":"string","required":true},{"name":"warehouse","in":"header","type":"string","required":true}]}},"/discrepancyList":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{"inventoryDiscrepList":{"$ref":"#/definitions/RESULTSET"},"messageReturn":"statusReturn":}}}},"parameters":[{"name":"expirationDateDisc","in":"query","type":"string","description":"Implicit parameter"},{"name":"export","in":"query","type":"string","description":"Implicit parameter"},{"name":"itemCode","in":"query","type":"string","description":"Implicit parameter"},{"name":"itemType","in":"query","type":"string","description":"Implicit parameter"},{"name":"limit","in":"query","type":"string","description":"Implicit parameter"},{"name":"lotNumber","in":"query","type":"string","description":"Implicit parameter"},{"name":"makeDateDisc","in":"query","type":"string","description":"Implicit parameter"},{"name":"offset","in":"query","type":"string","description":"Implicit parameter"},{"name":"primaryQtyDisc","in":"query","type":"string","description":"Implicit parameter"},{"name":"stockLocator","in":"query","type":"string","description":"Implicit parameter"},{"name":"userSessionId","in":"query","type":"string","description":"Implicit parameter"}]}},"/history":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{"inventoryHistoryList":{"$ref":"#/definitions/RESULTSET"},"messageReturn":"statusReturn":}}}},"parameters":[{"name":"export","in":"query","type":"string","description":"Implicit parameter"},{"name":"limit","in":"query","type":"string","description":"Implicit parameter"},{"name":"locationName","in":"query","type":"string","description":"Implicit parameter"},{"name":"offset","in":"query","type":"string","description":"Implicit parameter"},{"name":"palletCode","in":"query","type":"string","description":"Implicit parameter"},{"name":"appointmentId","in":"header","type":"string","required":true},{"name":"batchNumber","in":"header","type":"string","required":true},{"name":"cartId","in":"header","type":"string","required":true},{"name":"dateFrom","in":"header","type":"string","required":true},{"name":"dateTo","in":"header","type":"string","required":true},{"name":"invType","in":"header","type":"string","required":true},{"name":"itemCode","in":"header","type":"string","required":true},{"name":"loadId","in":"header","type":"string","required":true},{"name":"lotNumber","in":"header","type":"string","required":true},{"name":"orderNumber","in":"header","type":"string","required":true},{"name":"org","in":"header","type":"string","required":true},{"name":"receiptOrderNumber","in":"header","type":"string","required":true},{"name":"transType","in":"header","type":"string","required":true},{"name":"unitId","in":"header","type":"string","required":true},{"name":"unitOfMeasure","in":"header","type":"string","required":true},{"name":"userId","in":"header","type":"string","required":true},{"name":"userSessionId","in":"header","type":"string","required":true}]}},"/inventorytypelist":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"locationName","in":"header","type":"string","required":true},{"name":"userSessionId","in":"header","type":"string","required":true}]}},"/itemDemandList":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"appointmentType","in":"query","type":"string","description":"Implicit parameter"},{"name":"export","in":"query","type":"string","description":"Implicit parameter"},{"name":"itemCode","in":"query","type":"string","description":"Implicit parameter"},{"name":"userSessionId","in":"query","type":"string","description":"Implicit parameter"}]}},"/itemDemandTotalsList":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"appointmentType","in":"query","type":"string","description":"Implicit parameter"},{"name":"export","in":"query","type":"string","description":"Implicit parameter"},{"name":"itemCode","in":"query","type":"string","description":"Implicit parameter"},{"name":"userSessionId","in":"query","type":"string","description":"Implicit parameter"}]}},"/iteminfo":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"export","in":"header","type":"string","required":true},{"name":"itemId","in":"header","type":"string","required":true},{"name":"limit","in":"header","type":"string","required":true},{"name":"offset","in":"header","type":"string","required":true},{"name":"userSessionId","in":"header","type":"string","required":true}]}},"/list":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{"inventoryList":{"$ref":"#/definitions/RESULTSET"},"message":"status":}}}},"parameters":[{"name":"batchNumber","in":"query","type":"string","description":"Implicit parameter"},{"name":"expirationDate","in":"query","type":"string","description":"Implicit parameter"},{"name":"expirationDateTo","in":"query","type":"string","description":"Implicit parameter"},{"name":"export","in":"query","type":"string","description":"Implicit parameter"},{"name":"groupByEntity","in":"query","type":"string","description":"Implicit parameter"},{"name":"includeZero","in":"query","type":"string","description":"Implicit parameter"},{"name":"inventoryType","in":"query","type":"string","description":"Implicit parameter"},{"name":"itemClassification","in":"query","type":"string","description":"Implicit parameter"},{"name":"itemCode","in":"query","type":"string","description":"Implicit parameter"},{"name":"limit","in":"query","type":"string","description":"Implicit parameter"},{"name":"locationName","in":"query","type":"string","description":"Implicit parameter"},{"name":"locationType","in":"query","type":"string","description":"Implicit parameter"},{"name":"lotNumber","in":"query","type":"string","description":"Implicit parameter"},{"name":"lotStatus","in":"query","type":"string","description":"Implicit parameter"},{"name":"makeDate","in":"query","type":"string","description":"Implicit parameter"},{"name":"makeDateTo","in":"query","type":"string","description":"Implicit parameter"},{"name":"offset","in":"query","type":"string","description":"Implicit parameter"},{"name":"orderBy","in":"query","type":"string","description":"Implicit parameter"},{"name":"otherOrganization","in":"query","type":"string","description":"Implicit parameter"},{"name":"owner","in":"query","type":"string","description":"Implicit parameter"},{"name":"palletCode","in":"query","type":"string","description":"Implicit parameter"},{"name":"prepriceYesNo","in":"query","type":"string","description":"Implicit parameter"},{"name":"produceTimeFrom","in":"query","type":"string","description":"Implicit parameter"},{"name":"produceTimeTo","in":"query","type":"string","description":"Implicit parameter"},{"name":"sortBy","in":"query","type":"string","description":"Implicit parameter"},{"name":"sscc","in":"query","type":"string","description":"Implicit parameter"},{"name":"unitId","in":"query","type":"string","description":"Implicit parameter"},{"name":"unitIdList","in":"query","type":"string","description":"Implicit parameter"},{"name":"unitOfMeasure","in":"query","type":"string","description":"Implicit parameter"},{"name":"userSessionId","in":"query","type":"string","description":"Implicit parameter"},{"name":"vendorLotNumber","in":"query","type":"string","description":"Implicit parameter"},{"name":"unitCode","in":"header","type":"string","required":true}]}},"/movepalletlist":{"post":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"locationName","in":"header","type":"string","required":true},{"name":"palletList","in":"header","type":"string","required":true},{"name":"userSessionId","in":"header","type":"string","required":true}]}},"/palletTrackingList":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{"message":"palletTrackingList":{"$ref":"#/definitions/RESULTSET"},"status":}}}},"parameters":[{"name":"accountNumber","in":"query","type":"string","description":"Implicit parameter"},{"name":"appointmentId","in":"query","type":"string","description":"Implicit parameter"},{"name":"dateFrom","in":"query","type":"string","description":"Implicit parameter"},{"name":"dateTo","in":"query","type":"string","description":"Implicit parameter"},{"name":"export","in":"query","type":"string","description":"Implicit parameter"},{"name":"grouping","in":"query","type":"string","description":"Implicit parameter"},{"name":"limit","in":"query","type":"string","description":"Implicit parameter"},{"name":"loadId","in":"query","type":"string","description":"Implicit parameter"},{"name":"offset","in":"query","type":"string","description":"Implicit parameter"},{"name":"orderNumber","in":"query","type":"string","description":"Implicit parameter"},{"name":"organization","in":"query","type":"string","description":"Implicit parameter"},{"name":"palletType","in":"query","type":"string","description":"Implicit parameter"},{"name":"transactionType","in":"query","type":"string","description":"Implicit parameter"},{"name":"userSessionId","in":"query","type":"string","description":"Implicit parameter"}]}},"/pallettypelist":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{"palletTypeList":{"$ref":"#/definitions/RESULTSET"},"returnMessage":"returnStatus":}}}},"parameters":[{"name":"export","in":"query","type":"string","description":"Implicit parameter"},{"name":"limit","in":"query","type":"string","description":"Implicit parameter"},{"name":"offset","in":"query","type":"string","description":"Implicit parameter"},{"name":"organization","in":"query","type":"string","description":"Implicit parameter"},{"name":"userSessionId","in":"query","type":"string","description":"Implicit parameter"},{"name":"weightUom","in":"query","type":"string","description":"Implicit parameter"}]}},"/partialpallets":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"org","in":"query","type":"string","description":"Implicit parameter"},{"name":"userSessionId","in":"query","type":"string","description":"Implicit parameter"}]}},"/productionloginfo":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"batchType","in":"header","type":"string","required":true},{"name":"dateFrom","in":"header","type":"string","required":true},{"name":"dateTo","in":"header","type":"string","required":true},{"name":"export","in":"header","type":"string","required":true},{"name":"groupByEntity","in":"header","type":"string","required":true},{"name":"userSessionId","in":"header","type":"string","required":true}]}},"/reclasspallets":{"post":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"itemCode","in":"header","type":"string","required":true},{"name":"palletIds","in":"header","type":"string","required":true},{"name":"userSessionId","in":"header","type":"string","required":true},{"name":"validateOnlyFlag","in":"header","type":"string","required":true}]}},"/requestmove":{"post":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"cartId","in":"header","type":"string","required":true},{"name":"forceMove","in":"header","type":"string","required":true},{"name":"thirdPartyLocationId","in":"header","type":"string","required":true},{"name":"userSessionId","in":"header","type":"string","required":true}]}},"/rmpulllist":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"batchStatuses","in":"header","type":"string","required":true},{"name":"export","in":"header","type":"string","required":true},{"name":"fromPlannedStart","in":"header","type":"string","required":true},{"name":"itemTypes","in":"header","type":"string","required":true},{"name":"locationTypes","in":"header","type":"string","required":true},{"name":"productionLines","in":"header","type":"string","required":true},{"name":"toPlannedStart","in":"header","type":"string","required":true},{"name":"userSessionId","in":"header","type":"string","required":true}]}},"/splitunit":{"post":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{"message":"status":}}}},"parameters":[{"name":"payload","in":"body","required":true,"schema":{"$ref":"#/definitions/PAYLOAD4"}}]}},"/stockcodeshipmentslist":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"expirationDate","in":"header","type":"string","required":true},{"name":"export","in":"header","type":"string","required":true},{"name":"itemCode","in":"header","type":"string","required":true},{"name":"orderNumber","in":"header","type":"string","required":true},{"name":"transactionDateFrom","in":"header","type":"string","required":true},{"name":"transactionDateTo","in":"header","type":"string","required":true},{"name":"userSessionId","in":"header","type":"string","required":true}]}},"/unitstatuslist":{"get":{"description":null,"responses":{"200":{"description":"output of the endpoint","schema":{"type":"object","properties":{}}}},"parameters":[{"name":"poReceivable","in":"query","type":"string","description":"Implicit parameter"},{"name":"userSessionId","in":"header","type":"string","required":true}]}}},"definitions":{"RESULTSET":{"type":"string"},"PAYLOAD1":{"properties":{"userSessionId":{"type":"string"},"unitId":{"type":"string"},"printerName":{"type":"string"},"copies":{"type":"string"},"locationName":{"type":"string"}}},"PAYLOAD2":{"properties":{"userSessionId":{"type":"string"},"organization":{"type":"string"},"palletType":{"type":"string"},"quantity":{"type":"string"},"orderHeaderId":{"type":"string"},"receiptId":{"type":"string"},"transactionDate":{"type":"string"}}},"PAYLOAD3":{"properties":{"itemCode":{"type":"string"},"quantity":{"type":"string"},"uom":{"type":"string"},"numberOfUnits":{"type":"string"},"organization":{"type":"string"}}},"PAYLOAD4":{"properties":{"userSessionId":{"type":"string"},"unitId":{"type":"string"},"quantity1":{"type":"string"},"uom1":{"type":"string"},"quantity2":{"type":"string"},"uom2":{"type":"string"},"locationName":{"type":"string"},"printerName":{"type":"string"},"copies":{"type":"string"}}}}}
        • 1. Re: Swagger JSON Parse Error
          thatJeffSmith-Oracle

          can you share something (code) we can use to reproduce?

          • 2. Re: Swagger JSON Parse Error
            Chad Boom

            Below is a paired down use case.  If I remove the out parameter definitions, it works.

             

            https:/xxxxxxxxxxxx/open-api-catalog/test/

             

            -- Generated by Oracle SQL Developer REST Data Services 19.1.0.094.2042

            -- Exported REST Definitions from ORDS Schema Version 3.0.11.180.12.34

            -- Schema: XXORDS   Date: Fri Aug 16 08:49:07 CDT 2019

            --

            BEGIN

              ORDS.ENABLE_SCHEMA(

                  p_enabled             => TRUE,

                  p_schema              => 'XXORDS',

                  p_url_mapping_type    => 'BASE_PATH',

                  p_url_mapping_pattern => 'xxords',

                  p_auto_rest_auth      => FALSE);   

             

             

              ORDS.DEFINE_MODULE(

                  p_module_name    => 'Test',

                  p_base_path      => '/test/',

                  p_items_per_page =>  0,

                  p_status         => 'PUBLISHED',

                  p_comments       => NULL);     

              ORDS.DEFINE_TEMPLATE(

                  p_module_name    => 'Test',

                  p_pattern        => 'testuri',

                  p_priority       => 0,

                  p_etag_type      => 'HASH',

                  p_etag_query     => NULL,

                  p_comments       => NULL);

              ORDS.DEFINE_HANDLER(

                  p_module_name    => 'Test',

                  p_pattern        => 'testuri',

                  p_method         => 'GET',

                  p_source_type    => 'plsql/block',

                  p_items_per_page =>  0,

                  p_mimes_allowed  => '',

                  p_comments       => NULL,

                  p_source         =>

            'begin

             

             

            :status := ''test'';

            :message := ''123'';

             

             

            end;'

                  );

              ORDS.DEFINE_PARAMETER(

                  p_module_name        => 'Test',

                  p_pattern            => 'testuri',

                  p_method             => 'GET',

                  p_name               => 'message',

                  p_bind_variable_name => 'message',

                  p_source_type        => 'RESPONSE',

                  p_param_type         => 'STRING',

                  p_access_method      => 'OUT',

                  p_comments           => NULL);     

              ORDS.DEFINE_PARAMETER(

                  p_module_name        => 'Test',

                  p_pattern            => 'testuri',

                  p_method             => 'GET',

                  p_name               => 'status',

                  p_bind_variable_name => 'status',

                  p_source_type        => 'RESPONSE',

                  p_param_type         => 'STRING',

                  p_access_method      => 'OUT',

                  p_comments           => NULL);     

             

             

             

             

              COMMIT;

            END;

            • 3. Re: Swagger JSON Parse Error
              Chad Boom

              thatJeffSmith-Oracle did you get a chance to try recreate?

              • 4. Re: Swagger JSON Parse Error
                thatJeffSmith-Oracle

                Nope...in the meantime you can open a Service Request with My Oracle Support if you want to own this process and get status updates

                 

                We don't monitor the forums for Support cases, and reporting Bugs is one of those things that falls into Support cases.

                 

                I'm in the bug world now, so I'll try to test/log this later today...