microsoft / microsoft/typespec
Seralize operation parameters as json(or other media type)
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
This is not something we supported in autorest but this is something available in openapi
See autorest issue where someone ask for support https://github.com/Azure/autorest/issues/4773
```json
{
"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](https://swagger.io/docs/specification/describing-parameters/#schema-vs-content).
Maybe could have something like that
```tsp
@encode("application/json")
@query
data: ComplexObject;
```
Contributor guide
Assessment
This issue has not been assessed yet.