-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add label from title #26
Conversation
What about changing label of pydantic model as title in drf_field? I want to change label field.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #26 +/- ##
==========================================
+ Coverage 98.83% 98.84% +0.01%
==========================================
Files 5 5
Lines 171 173 +2
==========================================
+ Hits 169 171 +2
Misses 2 2 ☔ View full report in Codecov by Sentry. |
Thank you for the contribution! Can you please add unit test for this and lint the code using ruff? |
Sure! I did it on 66a7034 |
I added more test case on ba6efb2 |
This is the code where if label is None, it gives default value. |
Looks good, let's merge it. Thank you for providing a reference for how it sets the default |
Hello! I'm using your drf-pydantic library to use pydantic model in my django project!
It is very good for cleaning my code, but I found that there is no method to set label in drf_field from drf-pydantic model.
So, I have a request.
What about changing title of pydantic model into label in drf_field? I want to change label field so that I can use it in from drf_yasg.utils import swagger_auto_schema
something like
so that I can auto-generate swagger(redoc) page