Skip to content

OpenAPI schema for FileField/ImageField is always string/binary #8625

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

Closed
3 tasks done
denisorehovsky opened this issue Aug 28, 2022 · 4 comments
Closed
3 tasks done

Comments

@denisorehovsky
Copy link
Contributor

Checklist

Request and response schemas have the same format for FileField and ImageField:

"some_field": {
    "type": "string",
    "format": "binary"
}

However, it's not correct. If you look at implementation of FileField, you will see that to_representation always returns string:
image

Response format should be url or no format at all if UPLOADED_FILES_USE_URL is false.

This was initially mentioned in #6863

@stale
Copy link

stale bot commented Nov 1, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 1, 2022
@stale stale bot removed the stale label Dec 15, 2022
@auvipy
Copy link
Member

auvipy commented Dec 15, 2022

closing not planned anymore

@auvipy auvipy closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2022
@syabro
Copy link

syabro commented May 15, 2023

@auvipy why? It's a problem for me right now...

@auvipy
Copy link
Member

auvipy commented May 15, 2023

the schema mechanism is planned for deprecation. but if you send bug fix then that will be accepted along with minor enhancements

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