2

I'm looking for way to represent as a restplus Api.model as a dictionary, the api that I have receives on a post call data such as

{"name": "the_name",
 "data": {"data_specific_key", "value", "key2": "value2" .... } 
}
// The data is dynamic, no way to know what fields will have. 

Unfortunately into the restplus Api I only have a way to represent ListFields.

I'm looking at https://flask-restplus.readthedocs.io/en/stable/marshalling.html#nested-field but not sure will help, perhaps I need to subclass the https://flask-restplus.readthedocs.io/en/stable/api.html#flask_restplus.fields.Raw and make my own field, thank you.

silviud
  • 1,015
  • 1
  • 12
  • 21

1 Answers1

5

FYI - I use directly fields.Raw, this is translated to object in swagger aka dictionary in py.

silviud
  • 1,015
  • 1
  • 12
  • 21