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
{{ message }}
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.
When passing a dict/hash of arbitrary data in an API, we're using DictField (same applies for JSONField). A good example is an errors collection, where we really don't want to define a serializer with all the possible elements it may contain. So we declare like this:
class CustomSerializer(serializers.Serializer):
errors = serializers.DictField(
required=False, help_text="Error conditions, if any"
)
The problem is this shows up in the swagger UI as a string:
CustomSerializer {
errors (string): Error conditions, if any
}
This is causing problems for API clients that are attempting to introspect on the basis of the swagger doc. Is there a way to define these elements better - at least not have them declared as a string? Am I missing something obvious?
Note we are still on 0.3.x branch (0.3.10)
The text was updated successfully, but these errors were encountered:
When passing a dict/hash of arbitrary data in an API, we're using
DictField
(same applies forJSONField
). A good example is an errors collection, where we really don't want to define a serializer with all the possible elements it may contain. So we declare like this:The problem is this shows up in the swagger UI as a string:
Likewise in swagger doc:
This is causing problems for API clients that are attempting to introspect on the basis of the swagger doc. Is there a way to define these elements better - at least not have them declared as a string? Am I missing something obvious?
Note we are still on 0.3.x branch (0.3.10)
The text was updated successfully, but these errors were encountered: