-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Schema Generator: serializer field from models.DurationField with MinValueValidator produces invalid output #8063
Comments
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. |
The problem still occurs in 3.13.1. I would guess this is related to #7641 |
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. |
I believe this is still current. |
Any keen code archeologists up for digging into what's needed to resolve this? |
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. |
I believe this is still current. |
I have found that as yaml Dumper convert time delta into python tag which is not renderable. so here we can add a custom representer for datetime.timedelta which converts it into 'str' tag which is similar to JSON OpenAPI Schema fix. #7641.
I have created PR for this #9007. |
@peterthomassen can you also review the PR please? |
Sorry for being late! I looked over the PR and couldn't spot anything problematic; OTOH I'm not too familiar with schema representations, and I'm not sure how specialized types are best represented. So, superficially, lgtm. That said, I very MUCH appreciate that DRF is seeing some movement now. Thank you very very much for working on it! <3 |
I will put effort to it. no worries |
I have a model with the following field:
The schema contains the following output:
This cannot be rendered by Swagger / ReDoc, leading to failures when loading the schema.
The text was updated successfully, but these errors were encountered: