From 8a46a87b3ee369bc7779742aa2a8d7fe8713c825 Mon Sep 17 00:00:00 2001 From: taoufik Date: Tue, 3 Dec 2019 19:37:46 +0100 Subject: [PATCH] Fix missing openapi title, version and openapi_version and black --- responder/api.py | 9 +++++---- responder/models.py | 4 +--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/responder/api.py b/responder/api.py index aca5b74..2fbd314 100644 --- a/responder/api.py +++ b/responder/api.py @@ -44,12 +44,13 @@ class API: *, debug=False, title=None, - version=None, + version="1.0", description=None, terms_of_service=None, contact=None, license=None, openapi=None, + openapi_version="3.0.2", openapi_route="/schema.yml", static_dir="static", static_route="/static", @@ -117,9 +118,9 @@ class API: if openapi or docs_route: self.openapi = OpenAPISchema( app=self, - title="Web Service", - version="1.0", - openapi="3.0.2", + title=title, + version=version, + openapi=openapi_version, docs_route=docs_route, description=description, terms_of_service=terms_of_service, diff --git a/responder/models.py b/responder/models.py index d39f318..ca8ed63 100644 --- a/responder/models.py +++ b/responder/models.py @@ -283,9 +283,7 @@ class Response: self.content = None #: A bytes representation of the response body. self.mimetype = None self.encoding = DEFAULT_ENCODING - self.media = ( - None - ) #: A Python object that will be content-negotiated and sent back to the client. Typically, in JSON formatting. + self.media = None #: A Python object that will be content-negotiated and sent back to the client. Typically, in JSON formatting. self._stream = None self.headers = ( {}