A well-behaved RESTful API provides the OpenAPI specification for the various services available. This is generally packaged in the /swagger.json route. This doesn't necessarily mean that a literal file is available. Instead, this path is used as a focus to provide the detailed interface specification in JSON notation following the Swagger 2.0 specification.
We've defined the route, /swagger.json, and bound a function, swagger3(), to this route. This function will create a JSON representation of a global object, specification:
@dealer.route('/dealer/swagger.json') def swagger3(): response = make_response(json.dumps(specification, indent=2).encode('utf-8')) response.headers['Content-Type'] = 'application/json' ...