Docs handler¶
Document File Handler
Module realizes doc file handler.
- class luna_events.crutches_on_wheels.web.docs_handler.DevelopmentManualHandler(request)¶
Handler for getting sphinx documentations from static directory
- property app: LunaApplication¶
Get application :rtype:
LunaApplication
:returns: running application
- property config¶
Get running application config :returns: running application config
- async get()¶
Get Sphinx service documentation, see get dev manual.
Resource is reached by address ‘/docs/dev’
- class luna_events.crutches_on_wheels.web.docs_handler.SpecDocumentsHandler(request)¶
Handler for getting openapi documentations from static directory
- property app: LunaApplication¶
Get application :rtype:
LunaApplication
:returns: running application
- property config¶
Get running application config :returns: running application config
- classmethod customise(docName=None)¶
Handler customising method.
- Parameters:
docName (
Optional
[str
]) – document name to store- Returns:
the current handler class
- property docName¶
Current REST API document name getter.
- Returns:
REST API document name except extension
- async get()¶
Get document of services, see get spec docs.
Resource is reached by address ‘/docs/spec’
- Raises:
VLException(Error.UnsupportedMediaType, 415, isCriticalError=False), if "Accept" header is incorrect –
- Return type:
HTTPResponse
- getDataFromStatic(extension)¶
Get file body from a static directory with the specified extension
- Parameters:
extension (
str
) – extension for document file (html or yml)- Return type:
Tuple
[str
,bytes
]- Returns:
tuple (filename, document body)
- luna_events.crutches_on_wheels.web.docs_handler.addDocHandlersRoutes(app, specDocName=None)¶
Add standard docs handlers (OpenAPI and sphinx) to app :type app:
LunaApplication
:param app: application :type specDocName:Optional
[str
] :param specDocName: custom spec doc name