Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seralize operation parameters as json(or other media type) #2479

Open
timotheeguerin opened this issue Sep 25, 2023 · 2 comments
Open

Seralize operation parameters as json(or other media type) #2479

timotheeguerin opened this issue Sep 25, 2023 · 2 comments
Labels
design:needed A design request has been raised that needs a proposal triaged:core
Milestone

Comments

@timotheeguerin
Copy link
Member

timotheeguerin commented Sep 25, 2023

This is not something we supported in autorest but this is something available in openapi

See autorest issue where someone ask for support Azure/autorest#4773

{
  "summary": "Return list of Scripts",
  "parameters": [
    {
      "name": "ScriptQuery",
      "in": "header",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/ScriptQuery"
          }
        }
      }
    }
  ]
}

From the openapi3 docs

Other Serialization Methods
style and explode cover the most common serialization methods, but not all. For more complex scenarios (for example, a JSON-formatted object in the query string), you can use the content keyword and specify the media type that defines the serialization format. For more information, see schema vs content.

Maybe could have something like that

@encode("application/json")
@query 
data: ComplexObject;
@bterlson
Copy link
Member

Seems related to #2476?

@timotheeguerin
Copy link
Member Author

Slightly though that one would I think just be style:deepObject in openapi3 so with our current way of specifying the params format it probably would be @query({format: "deepObject"}) or similar

@markcowl markcowl added the design:needed A design request has been raised that needs a proposal label Oct 9, 2023
@markcowl markcowl added this to the Backlog milestone Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design:needed A design request has been raised that needs a proposal triaged:core
Projects
None yet
Development

No branches or pull requests

3 participants