8000 Adding support for Content in Parameters by Gaelik-git · Pull Request #1399 · juhaku/utoipa · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Adding support for Content in Parameters #1399

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Gaelik-git < 8000 /div>
Copy link

The goal is to support the content key in the Parameter Object

Described here : https://spec.openapis.org/oas/v3.1.0.html#fixed-fields-9

For more complex scenarios, the content property can define the media type and schema of the parameter. A parameter MUST contain either a schema property, or a content property, but not both. When example or examples are provided in conjunction with the schema object, the example MUST follow the prescribed serialization strategy for the parameter.

It offers the possibility to create openapi spec like this :

paths:
  /api/v1/myendpoint
    get:
      tags:
      - myendpoint
      summary: Some summary of my endpoint
      operationId: myendpoint_operation
      parameters:
      - name: filters
        in: query
        description: Additional filters to add to the query
        required: false
        content: 
          application/json:
            schema:            
              $ref: '#/components/schemas/Filters'

The implementation is quite simplistic as it does not forbid to had both a schema and a content to a parameter
Also I am not familiar with macro

This is linked to this issue

@Gaelik-git Gaelik-git force-pushed the blm/adding_content_support_for_parameters branch 2 times, most recently from 29ba814 to e9ea890 Compare May 28, 2025 14:12
@Gaelik-git Gaelik-git force-pushed the blm/adding_content_support_for_parameters branch from e9ea890 to d4eb17e Compare May 28, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

345A
1 participant
0