Allow null values in JSON response from python-flask swagger app? Allow null values in JSON response from python-flask swagger app? flask flask

Allow null values in JSON response from python-flask swagger app?


Figured it out. The beginning of the generated __main__.py looks like this:

from swagger_server import encoderdef main():    app = connexion.App(__name__, specification_dir='./swagger/')    app.app.json_encoder = encoder.JSONEncoder

I needed to add

app.app.json_encoder.include_nulls = True

Afterwards.