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

[server] schema/doc/serializers: FileField type is always string/binary #151

Open
gnuletik opened this issue Feb 6, 2020 · 2 comments
Open
Assignees
Milestone

Comments

@gnuletik
Copy link
Collaborator

gnuletik commented Feb 6, 2020

For example, the retrieveItem operation's return type (you need to click on the 200 button to show the response types) is described as string <binary>.
In fact, the input type is string <binary> but the return type should be string <url>.

The OpenAPI specs example has an example for file uploads but there is no example on how it should behave with a Component referenced (as the schema is using).

Maybe we should use a different component for the request type and response type?

@Tointoin
Copy link
Collaborator

Tointoin commented Feb 11, 2020

You're PR doesn't seems to provoke the problem:
I have got same beahaviour in schema generation with FileField with regular DRF 3.11 i. e. source_file gives string <binary> type with request and response

@gnuletik
Copy link
Collaborator Author

Ok, good to know :) Thanks for having a look at it @Tointoin !
It seems that there is an open issue about it on DRF repo : encode/django-rest-framework#6863

@yomguy yomguy added this to the 1.2 milestone Jan 24, 2023
@yomguy yomguy assigned yomguy and unassigned Tointoin Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants