Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-1589

/$query shall allow Content-Type: application/json

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: V4.01_OS
    • Fix Version/s: V4.02
    • Component/s: URL Conventions
    • Labels:
      None
    • Proposal:
      Hide

      See description

      Note: this would allow providing "literal" values to non-binding function parameters of type Edm.Stream introduced by ODATA-1481 because there's now a natural way to provide the content-type in addition to the stream data:

      {
        "Thumbnail@mediaContentType": "image/jpeg",
        "Thumbnail": "...base64url encoded value...",
      }
      
      Show
      See description Note: this would allow providing "literal" values to non-binding function parameters of type Edm.Stream introduced by ODATA-1481 because there's now a natural way to provide the content-type in addition to the stream data: { "Thumbnail@mediaContentType" : "image/jpeg" , "Thumbnail" : "...base64url encoded value..." , }

      Description

      JSON as content type should also be supported by /$query:

      POST ~/$query
      Content-Type: application/json
      
      {"$filter": "a eq 1",
       "$select": "b"}
      

      This is especially useful for complex function parameters, that would then be represented as if they were action parameters:

      POST ~/Countries('DE')/GetPostcodes
      Content-Type: application/json
      
      {"$filter": "ValidityStart gt 2020-01-01",
       "City": "Heidelberg",
       "Address": {"Street": "Hauptstraße", "Number": "1"}}
      

      Note that

      • the name of the bound function in the URL is without parentheses (because the parameters are in the body)
      • all parameter values in the JSON payload must be literals (whereas in the URL they could be aliases that evaluate to arbitrary expressions)
      • the /$query segment in the URL is optional and has been omitted here. (There is no risk of misinterpreting a function invocation URL.)

        Attachments

          Activity

            People

            • Assignee:
              heiko.theissen Heiko Theissen
              Reporter:
              heiko.theissen Heiko Theissen
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: