Closed YannickTeKulve closed 8 months ago
Describe the bug The open api spec states: A parameter MUST contain either a schema property, or a content property, but not both. See also https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md and this example: https://github.com/OAI/OpenAPI-Specification/blob/19765c1eff1f733802b1c6f14cf8a073fb7a5b25/examples/v3.0/petstore-expanded.yaml#L113C11-L116C1
A parameter MUST contain either a schema property, or a content property, but not both.
But when generating path or query parameters these are missing
To Reproduce The following comments:
// @Router /foo/{name} [put] // @Param name path string true "The name"
Generates:
/foo/{name}: put: parameters: - description: The name in: path name: name required: true type: string responses: {}
Expected behavior Should be:
/foo/{name}: put: parameters: - description: The name in: path name: name required: true schema: type: string responses: {}`
Your swag version v1.16.3
Your go version 1.21
Desktop (please complete the following information):
Additional context Also for json
Close: v2 vs v3 openapi spec
Describe the bug The open api spec states:
A parameter MUST contain either a schema property, or a content property, but not both.
See also https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md and this example: https://github.com/OAI/OpenAPI-Specification/blob/19765c1eff1f733802b1c6f14cf8a073fb7a5b25/examples/v3.0/petstore-expanded.yaml#L113C11-L116C1But when generating path or query parameters these are missing
To Reproduce The following comments:
Generates:
Expected behavior Should be:
Your swag version v1.16.3
Your go version 1.21
Desktop (please complete the following information):
Additional context Also for json