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

add support for multiple request body types #42

Open
mnahkies opened this issue Apr 22, 2023 · 0 comments
Open

add support for multiple request body types #42

mnahkies opened this issue Apr 22, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@mnahkies
Copy link
Owner

It's possible to declare different request bodies for different content types.

Currently we simply use the first one that we find:

// todo support multiple request body types
for (const [requestBodyContentType, definition] of Object.entries(requestBody.content)) {
return {
requestBodyContentType,
requestBodyParameter: {
name: "requestBody",
description: requestBody.description,
in: "body",
required: requestBody.required,
schema: definition.schema,
allowEmptyValue: false,
deprecated: false,
},
}
}

At a minimum we should support:

  • multipart/form-data
  • application/octet-stream
  • text/plain

Ideally we'd additionally support XML, but that might be left for it's own issue.

@mnahkies mnahkies added the enhancement New feature or request label Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant