Skip to content

Change Field to TextField#40

Closed
Diegovsky wants to merge 2 commits into
ericls:mainfrom
Kirei-Systems:main
Closed

Change Field to TextField#40
Diegovsky wants to merge 2 commits into
ericls:mainfrom
Kirei-Systems:main

Conversation

@Diegovsky
Copy link
Copy Markdown

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.

@avelis
Copy link
Copy Markdown

avelis commented Oct 17, 2025

models.CharField is likely a better field type to use moving forward. But thanks for providing this.

@avoid-ashraful
Copy link
Copy Markdown

Can we merge this change ? @ericls @Diegovsky

@ericls ericls mentioned this pull request Nov 11, 2025
@ericls
Copy link
Copy Markdown
Owner

ericls commented Nov 12, 2025

merged in #41 thanks!

@ericls ericls closed this Nov 12, 2025
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.

4 participants