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

Set valid consumes if file parameter #882

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

spaceraccoon
Copy link
Contributor

As per #881, this adds a check if any of the parameters are of file type and if consumes is not set to either application/x-www-form-urlencoded or multipart/form-data, it will set it to both in accordance to the OpenAPI v2 spec that only allows these values for file parameters. It will also set all other parameters in the method to formData as formData and body parameters cannot both be in the same method. Currently, by default if a file parameter is included, the consumes will be set to an invalid application/json.

@spaceraccoon spaceraccoon force-pushed the spaceraccoon-handle-file-parameter-type branch from ba881bc to eba6cb2 Compare November 15, 2022 17:31
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