2

I am trying to build a flask restplus model for the following structure.

"data": {
            "file1": 79,
            "file2": 72
        }

file1 and file2 are file names and it changes every time I run the app. The best solution I could think of was to use Wildcard fields.

wild = fields.Wildcard(fields.String)
wildcard_fields = {'*': wild}

When I run, I get AttributeError: module 'flask_restplus.fields' has no attribute 'Wildcard'

Please help me resolve this issue or any other solution is also appreciated.

Thanks!

Shashank BR
  • 65
  • 1
  • 6

1 Answers1

0

Did you try to update your librairies ? Wildcard is recent so it might be the problem.

  • I tried to update them but nothing changed. I referred to this link "https://github.com/noirbizarre/flask-restplus/pull/255" and tried to implement the changes but their code was in python 2 and I'm using python 3.7 so I couldn't do it either. Currently I've changed the structure of my data to work without wildcard fields but I'll try updating it again in few days and if it works, I'll post it here. – Shashank BR Sep 20 '19 at 20:00