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

feat: support multiple content type schemas per request body #819

Merged

Conversation

vivedo
Copy link
Contributor

@vivedo vivedo commented Sep 17, 2024

Handle different schemas per content type specified in the request body after Fastify added support for it in fastify/fastify#5545

Specifying more than one schema generated an incorrect OpenAPI spec:

{
  // ...
  "requestBody":{
    "content":{
      "application/json":{
        "schema":{
          "content":{
            "application/json":{
              "schema": {
                // ...
              }
            },
            "application/xml":{
              "schema": {
                // ...
              }
            }
            // ...
          }
        }
      }
    }
  }
}

Checklist

@vivedo vivedo changed the title feat: support multiple content type schemas per request feat: support multiple content type schemas per request body Sep 18, 2024
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit 03783d5 into fastify:master Sep 26, 2024
11 checks passed
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.

2 participants