Skip to content

Commit

Permalink
add security option
Browse files Browse the repository at this point in the history
  • Loading branch information
vvcheremushkin committed Dec 11, 2019
1 parent 4979c5f commit 1694188
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_packages(package):
"starlette<=1",
"apispec<3",
],
version="0.0.10",
version="0.0.11",
url="https://github.com/slv0/start_resty",
license="BSD",
description="The web framework",
Expand Down
6 changes: 5 additions & 1 deletion star_resty/apidocs/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,12 @@ def setup_operation(endpoint: Method, version=2):
'summary': options.summary,
'produces': [endpoint.serializer.media_type],
'parameters': resolve_parameters(meta),
'responses': resolve_responses(endpoint)
'responses': resolve_responses(endpoint),
}

if options.security is not None:
res['security'] = options.security

if version > 2:
res['requestBody'] = resolve_request_body(meta)
else:
Expand Down
4 changes: 4 additions & 0 deletions star_resty/operation/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ class Operation(NamedTuple):
description: Optional[str] = None
summary: Optional[str] = None
errors: Sequence[Any] = ()
security: Optional[Sequence] = None

def update(self, **kwargs):
return self._replace(**kwargs)

0 comments on commit 1694188

Please sign in to comment.