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 body parameters to requestBody field in case if openapi 3 is used #131

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

Conversation

arcan1s
Copy link

@arcan1s arcan1s commented Apr 24, 2023

According to documentation https://apispec.readthedocs.io/en/latest/api_ext.html#apispec.ext.marshmallow.openapi.OpenAPIConverter.schema2parameters in=body parameter is no longer allowed for parameters list and must be set to requestBody

This MR simply set data to another field based on location parameter, only tests have to be significantly hacked.

@arcan1s
Copy link
Author

arcan1s commented Apr 24, 2023

Probably we should consider split root openapi definition class (AiohttpApiSpec) into multiple subclasses each of them provides support only for specific openapi version, at least it would allow to decrease amount of if openapi_version.major < 3 blahblah and adjust tests accordingly (i.e. instead of testing aiohttp application, just check generator)

Also (but I'm not sure probably I miss something), in my environment asyncio tests are skipped, because it failed to find plugin, iirc asyncio_mode = auto has to be added to pytest configuration

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.

None yet

1 participant