xia_openapi_flask.openapi.XiaOpenapiFlask
- class xia_openapi_flask.openapi.XiaOpenapiFlask
Bases:
object
- __init__()
Methods
__init__
()compile_page
(resource_mapping, ...[, ...])Compile the static html pages who will hold the api pages
get_api_doc_blueprint
(path_name, ...[, ...])Get blueprint for API Documentation
Attributes
resource_template
- classmethod compile_page(resource_mapping: dict, html_location: str, schema_location: str, js_location: str, by_resource: bool = False)
Compile the static html pages who will hold the api pages
- Parameters
resource_mapping – URL map given by the application
html_location – location of html file to be generated. Normally should start with /templates
schema_location – location to where all compiled schema files generated. Normally should start with /static
js_location – translation javascript location. Normally should start with /static/js
by_resource – when True, will generate a specification file per resource name
Returns:
- classmethod get_api_doc_blueprint(path_name: str, template_location: str, by_resource: bool = False)
Get blueprint for API Documentation
- Parameters
path_name – blueprint path name
template_location – file location related to template directory
by_resource – separating API specification by resource if page is too huge
Returns: