Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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"
}
like image 903
Tom DARBOUX Avatar asked Jun 21 '19 09:06

Tom DARBOUX


1 Answers

Sorry this is not possbile with JSON Schema.

The types are the primitive types allowed by JSON.

like image 134
Relequestual Avatar answered Oct 19 '22 03:10

Relequestual