-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support title keyword #191
Conversation
@gthieleb thanks for the PR. generally, i'm in favor of adding a way to include the the PR clearly shows that the current approach adds a lot of noise without adding information (in the default case). i understand that the i also have some stylistic remarks, but above issue takes precedence. |
Hi @tfranzel, thanks for your comments. I missed to push one commit that should be there now. I fully agree with you. If someone is not relying on the additional information from the schema this might look like noise and in the worst case looks inconsistence (e.g. by using another inflecting style). For me I have made some experience with optimistic inflection on the frontend and IMO it is not the cleanest approach. To be more defensivly. Do you think about adding a configuration switch that enables Btw. Iniitially i mentioned another use case for the
So this will likely go part of another feature request. |
ideally spectacular could find out if fyi: spectacular does support i18n in the confines of OpenApi 3.0.3. you can retrieve a translated schema with the view ( there is also a generic issue for extensions #165, but it is not that straight forward how to do that properly. |
Any updates here or in #286 ? Maybe a good idea could be to have a variable in settings that could control showing or hiding titles base on labels/verbose_names. I'm interested in this feature because now I need to custom override an |
het @gthieleb, sry for the long wait. i had to go the extra mile but i found a way to get the title without the noise. fyi: parameters do not have a |
hey @tfranzel thanks for your update and the support of this. I will test and let you know something is open. |
This PR adds the
title
keyword of a DRF serializer field toproperties
schema.The usage is to expose and maintain a more descriptive name of the field in the backend.
This can be used in the frontend e.g. for the label of a formfield or the headerline of a table.
The keyword is derived from the DRF serializer field attribute
label
. In case ofModelSerializer
it is extracted from the model field attributeverbose_name
.References #140