Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-1372

Error response is always coming in "application/json" format if url has the query parameters in it

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Blocker
    • Resolution: Unresolved
    • (Java) V4 4.5.0, (Java) V4 4.6.0
    • (Java) V4 5.0.1
    • odata2-core, odata4-server
    • None
    • windows 10 - 64 bit operating system
      using java jdk 1.8.192
    • Patch, Important

    Description

      If we make an odata api call with query parameters included (for example ?$top=2) as per the uri specification in odata documentation (https://www.odata.org/documentation/odata-version-2-0/uri-conventions/) with content type as "application/xml" in headers then the response object is coming in "application/xml" format which is expected but If there any error by any case then the error response format is always coming in "application/json" format instead of "application/xml".

        The expected error response format should always match the requested content type which is "application/xml" in my case.

       

      for example :

      Current Error Response with Content Type = application/xml and Accept = application/xml

      {
      "error":

      { "code": null, "message": "Cannot find EntitySet, Singleton, ActionImport or FunctionImport with name 'XXXXXX'." }

      }

      Expected Response should be :

      Expected Result:
      <error xmlns="http://docs.oasis-open.org/odata/ns/metadata">
      <code>null</code>
      <message>
      Cannot find EntitySet, Singleton, ActionImport or FunctionImport with name 'XXXXXX'.
      </message>
      </error>

      Please kindly look into this issue as it is blocking my release.

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            chemsimulation Venkateswara Raju Chodraju
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: