Json schema django rest framework, describe json field as json and not as string

708 Views Asked by At

I have an Api in DRF, describes with swagger. In my serializer i have a field like that :

settings = serializers.DictField(child=serializers.JSONField())

Is it possible that in the swagger.json the field was describe as 'Json' and not as string:

"additionalProperties": {
            "type": "string"
}

but

"additionalProperties": {
        "type": "JSON"
}
1

There are 1 best solutions below

3
Relequestual On BEST ANSWER

Sorry this is not possbile with JSON Schema.

The types are the primitive types allowed by JSON.