Skip to content

Change Field to TextField #40

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

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

Conversation

Diegovsky
Copy link

While trying to use HashidsField with DRF and django-spectacular (DS) (an OpenAPI schema generator for DRF), I got errors which accused HashidsField of not mapping correctly into any specific OpenAPI type.

This stems from the fact that HashidsField, while for all intents and purposes acts like a str, does not have a way to tell this to DS. A simple fix would be to make HashidsField inherit from TextField instead of Field. I believe this is correct but I'm open to feedback.

I'm not familiar enough with the django ecosystem to understand how to run the tests from this repo, but at a first glance, basic queries worked flawlessly in my project.

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.

1 participant