forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin' into 7.0.x
This commit is contained in:
@@ -38,7 +38,7 @@ pytest
|
||||
|
||||
## Prevent file overriding
|
||||
|
||||
After first generation, add edited files to _.openapi-generator-ignore_ to prevent generator to overwrite them. Typically:
|
||||
After first generation, add edited files to _.openapi-generator-ignore_ to prevent generator from overwriting them. Typically:
|
||||
```
|
||||
server/controllers/*
|
||||
test/*
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
from typing import List
|
||||
|
||||
|
||||
def info_from_api_key(api_key: str, required_scopes: None) -> dict:
|
||||
"""
|
||||
Check and retrieve authentication information from api_key.
|
||||
Returned value will be passed in 'token_info' parameter of your operation function, if there is one.
|
||||
'sub' or 'uid' will be set in 'user' parameter of your operation function, if there is one.
|
||||
Should return None if api_key is invalid or does not allow access to called API.
|
||||
"""
|
||||
return {'uid': 'user_id'}
|
||||
|
||||
|
||||
def info_from_petstore_auth(token: str) -> dict:
|
||||
"""
|
||||
Validate and decode token.
|
||||
@@ -26,3 +16,13 @@ def validate_scope_petstore_auth(required_scopes: List[str], token_scopes: List[
|
||||
""" Validate required scopes are included in token scope """
|
||||
return set(required_scopes).issubset(set(token_scopes))
|
||||
|
||||
|
||||
def info_from_api_key(api_key: str, required_scopes: None) -> dict:
|
||||
"""
|
||||
Check and retrieve authentication information from api_key.
|
||||
Returned value will be passed in 'token_info' parameter of your operation function, if there is one.
|
||||
'sub' or 'uid' will be set in 'user' parameter of your operation function, if there is one.
|
||||
Should return None if api_key is invalid or does not allow access to called API.
|
||||
"""
|
||||
return {'uid': 'user_id'}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ async def get_inventory(request: web.Request, ) -> web.Response:
|
||||
async def get_order_by_id(request: web.Request, order_id) -> web.Response:
|
||||
"""Find purchase order by ID
|
||||
|
||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
|
||||
|
||||
:param order_id: ID of pet that needs to be fetched
|
||||
:type order_id: int
|
||||
|
||||
@@ -359,7 +359,7 @@ paths:
|
||||
x-openapi-router-controller: openapi_server.controllers.store_controller
|
||||
get:
|
||||
description: For valid response try integer IDs with value <= 5 or > 10. Other
|
||||
values will generated exceptions
|
||||
values will generate exceptions
|
||||
operationId: get_order_by_id
|
||||
parameters:
|
||||
- description: ID of pet that needs to be fetched
|
||||
|
||||
Reference in New Issue
Block a user