Skip to Main Content

ORDS, SODA & JSON in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Optional parameter "q" and 400 error (ORDS 18.3)

Olafur TOct 23 2018 — edited Oct 25 2018

Hi,

Was testing the migration of some of our legacy services. DB version 11.2 and 12.1.02 all show the same 400 error.

We used the parameter q as in "query string". Used in a lot of places, but ORDS will always give a 400 error.     

       Caused by: oracle.dbtools.json.JSONParserException: Expected one of: <<{,[>> but got: <<1>>   (where 1 is the first letter of the parameter)

change it to q1= no problem, all of the other letters I tried did not produce the error. o,p,w,e,r etc..

The test module is simple, call it with all kinds of parameters and it works fine. Use "q" and it results in a 400 error:

BEGIN

  ORDS.DEFINE_MODULE(

      p_module_name    => 'Testing',

      p_base_path      => '/testing/',

      p_items_per_page =>  25,

      p_status         => 'PUBLISHED',

      p_comments       => NULL);     

  ORDS.DEFINE_TEMPLATE(

      p_module_name    => 'Testing',

      p_pattern        => 'date',

      p_priority       => 0,

      p_etag_type      => 'HASH',

      p_etag_query     => NULL,

      p_comments       => NULL);

  ORDS.DEFINE_HANDLER(

      p_module_name    => 'Testing',

      p_pattern        => 'date',

      p_method         => 'GET',

      p_source_type    => 'json/query;type=single',

      p_items_per_page =>  0,

      p_mimes_allowed  => '',

      p_comments       => NULL,

      p_source         =>

'select sysdate from dual'

      );

  COMMIT;

END;

Thank you

Olafur

This post has been answered by Pierre Yotti on Oct 25 2018
Jump to Answer
Comments
Post Details
Added on Oct 23 2018
5 comments
1,304 views