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

OpenAPI: Map renderers/parsers for request/response media-types. #6865

Merged
merged 6 commits into from Nov 6, 2019

Conversation

knivets
Copy link
Contributor

@knivets knivets commented Aug 11, 2019

Issue #6863

TL;DR I ended up implementing an automatic parser/renderer mapping to corresponding request/response media type. The tests are passing.

So while testing this I discovered that every endpoint that supports request body, accepts multipart requests even if there are no file fields in serializers. This is correct since this is how DRF default parsers setting actually works. So there is no longer a need to handle endpoints that accept files in a special way. Anyway, this is just an idea let me know what you think @carltongibson @tomchristie

@knivets
Copy link
Contributor Author

knivets commented Aug 20, 2019

@carltongibson and this one too 😄

@carltongibson
Copy link
Collaborator

carltongibson commented Aug 21, 2019

HI @knivets. Yes. It's on the list. Just a question of bandwidth. They're not forgotten. 👍

Copy link
Collaborator

@carltongibson carltongibson left a comment

Hi @knivets. OK, this looks great.

We could probably just do with some tests checking a view with different parsers/renderers, to confirm the request/responses are correctly generated. Do you have the bandwidth to add a couple of those?

@carltongibson
Copy link
Collaborator

carltongibson commented Sep 3, 2019

(I squashed, rebased, and edited a little bit...)

@carltongibson carltongibson self-assigned this Sep 3, 2019
@carltongibson carltongibson changed the title [WIP] OpenAPI multipart media type Schemas: Map renderers/parsers for request/response media-types. Sep 3, 2019
@knivets
Copy link
Contributor Author

knivets commented Sep 5, 2019

Sure, I'll try to add some tests by the end of the week.

@knivets
Copy link
Contributor Author

knivets commented Sep 15, 2019

Hey @carltongibson, please have a look at the updates I've pushed. Let me know if you have any feedback.

@knivets
Copy link
Contributor Author

knivets commented Sep 29, 2019

Any update on this @carltongibson?

@carltongibson carltongibson self-requested a review Oct 1, 2019
@carltongibson
Copy link
Collaborator

carltongibson commented Oct 1, 2019

Hi @knivets. Sorry for the delay. Been Busy™. Looking good — I'll have a proper look this week. 🥇

@knivets
Copy link
Contributor Author

knivets commented Oct 1, 2019

No worries @carltongibson

@carltongibson carltongibson mentioned this pull request Oct 10, 2019
@carltongibson carltongibson added this to the 3.11 Release milestone Nov 6, 2019
Copy link
Collaborator

@carltongibson carltongibson left a comment

OK, great stuff. Sorry for the delay in getting to you @knivets! Thanks so much. 🥇

@carltongibson carltongibson merged commit 8b06ce7 into encode:master Nov 6, 2019
1 check passed
@carltongibson carltongibson changed the title Schemas: Map renderers/parsers for request/response media-types. OpenAPI: Map renderers/parsers for request/response media-types. Nov 6, 2019
pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this issue Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants