Azure / autorest

OpenAPI (f.k.a Swagger) Specification code generator. Supports C#, PowerShell, Go, Java, Node.js, TypeScript, Python
MIT License
4.58k stars 730 forks source link

Parameter 'ScriptQuery' in 'header' has content.<mediaType> which is not supported right now. Use schema instead. #4773

Open mdaneri opened 11 months ago

mdaneri commented 11 months ago

The problem is that the JSON is correct

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

I don't know why is reporting this issue

dolauli commented 11 months ago

Seems to be an issue of autorest.

timotheeguerin commented 11 months ago

Autorest doesn’t support header, query parameters that are json(or other seeialization format) it only support the style options in openapi3

mdaneri commented 11 months ago

Thanks for the reply It's a fundamental feature. When will it be implemented?

timotheeguerin commented 11 months ago

Hi @mdaneri, this feature is not on our roadmap at the moment, autorest supports only a subset of OpenAPI3 and this is the first time we got a request for this.

As a workaround you can represent the parameter as a string and let the user serialize it.