The OpenAPI schema generation setup we are using does not have a really great solution for documenting the structure of JSONField members. Currently they are documented in the schema something like:
url_alternates : { <any-key>: {missing-type-info} }
This does not tell the caller what they are expected to submit.
drf-spectacular allows adding OpenApiSerializerFieldExtension subclasses to change the serializer information (the missing-type-info above basically). This has a drawback that I have not found a solution for however. To apply a OpenApiSerializerFieldExtension fix one must make a named target class to apply it to rather than somehow decorating the existing model field. This in turn breaks the ability to inherit the API field's description and help_text from the backing model. So right now we can either have:
- good help text and no structure
- good structure and no help text
We need to find a way to get both. That may end up requiring a discussion upstream to either find a hidden feature in drf/drf-spectacular or to invent something new.