code: def _openapi_json(self):
          
          # We don't use Flask.jsonify here as it would sort the keys
          # alphabetically while we want to preserve the order.
          from pprint import pprint
          pprint(self.to_dict())
          return current_app.response_class(json.dumps(self.to_dict(), indent=4),
                                            mimetype='application/json')
docs: Serve JSON spec file