in src/services/openapi_spec_generator.py [0:0]
def _generate_base(self) -> OpenApiV3:
match self._stages:
case str():
stages = {'default': self._stages, 'description': 'Main stage'}
case _: # list()
stages = {
'default': self._stages[0],
'description': 'Api stage',
'enum': self._stages
}
return {
'openapi': '3.0.3',
'info': {
'title': self._title,
'description': self._description,
'version': self._version,
'license': {
'name': 'Apache 2.0',
'url': 'http://www.apache.org/licenses/LICENSE-2.0.html'
}
},
'servers': [{
'url': urljoin(url, '{stage}'),
'description': 'Main url',
'variables': {'stage': stages}
} for url in self._urls],
'paths': {},
'tags': [],
'components': {
'schemas': {},
'securitySchemes': {
'access_token': {
'type': 'apiKey',
'description': 'Simple token authentication. The same as AWS Cognito and AWS Api gateway integration has',
'name': 'Authorization',
'in': 'header',
}
}
}
}