You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Swagger is automatically inferring a "string" type for fields using "TranslationSerializerField" under the hood it is a CharField, but the i/o represents as a dictionary for each locale having a key/value pair.
What did you expect to happen?
We should update the swagger introspection to represent this field as a dictionary with valid local keys and string values.
It's possibly because under api/v3 and api/v4 Translated fields can be a string - if a lang parameter is passed it'll be a simple string in the response; and a simple string can be provided in a POST/PATCH/PUT to update, as an alternative to a dict/object.
(In api/v5 that was changed - now responses are always a dict/object, and a dict/object must always be provided for an update)
We could potentially solve this with static annotations on the serializer, however this would also imply we need to consider the version in the static definition... we could ALSO consider dropping support for v3/4 from swagger to simplify and make sure swagger is future focused.
What happened?
Swagger is automatically inferring a "string" type for fields using "TranslationSerializerField" under the hood it is a CharField, but the i/o represents as a dictionary for each locale having a key/value pair.
What did you expect to happen?
We should update the swagger introspection to represent this field as a dictionary with valid local keys and string values.
Is there an existing issue for this?
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: