OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, title, version, openapi_version, plugins=(), **options) |
def | to_dict (self) |
def | to_yaml (self, yaml_dump_kwargs=None) |
def | tag (self, tag) |
def | path (self, path=None, *operations=None, summary=None, description=None, parameters=None, **kwargs) |
def | get_ref (self, obj_type, obj) |
def | clean_parameters (self, parameters) |
def | clean_operations (self, operations) |
Data Fields | |
title | |
version | |
openapi_version | |
options | |
plugins | |
components | |
Stores metadata that describes a RESTful API using the OpenAPI specification. :param str title: API title :param str version: API version :param list|tuple plugins: Plugin instances. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#infoObject :param str|OpenAPIVersion openapi_version: OpenAPI Specification version. Should be in the form '2.x' or '3.x.x' to comply with the OpenAPI standard. :param options: Optional top-level keys See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#openapi-object
def __init__ | ( | self, | |
title, | |||
version, | |||
openapi_version, | |||
plugins = () , |
|||
** | options | ||
) |
def clean_operations | ( | self, | |
operations | |||
) |
Ensure that all parameters with "in" equal to "path" are also required as required by the OpenAPI specification, as well as normalizing any references to global parameters. Also checks for invalid HTTP methods. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject. :param dict operations: Dict mapping status codes to operations
def clean_parameters | ( | self, | |
parameters | |||
) |
Ensure that all parameters with "in" equal to "path" are also required as required by the OpenAPI specification, as well as normalizing any references to global parameters and checking for duplicates parameters See https ://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameterObject. :param list parameters: List of parameters mapping
def get_ref | ( | self, | |
obj_type, | |||
obj | |||
) |
Return object or reference If obj is a dict, it is assumed to be a complete description and it is returned as is. Otherwise, it is assumed to be a reference name as string and the corresponding $ref string is returned. :param str obj_type: "schema", "parameter", "response" or "security_scheme" :param dict|str obj: object in dict form or as ref_id string
def path | ( | self, | |
path = None , |
|||
* | operations = None , |
||
summary = None , |
|||
description = None , |
|||
parameters = None , |
|||
** | kwargs | ||
) |
Add a new path object to the spec. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#path-item-object :param str|None path: URL path component :param dict|None operations: describes the http methods and options for `path` :param str summary: short summary relevant to all operations in this path :param str description: long description relevant to all operations in this path :param list|None parameters: list of parameters relevant to all operations in this path :param kwargs: parameters used by any path helpers see :meth:`register_path_helper`
def tag | ( | self, | |
tag | |||
) |
Store information about a tag. :param dict tag: the dictionary storing information about the tag.
def to_dict | ( | self | ) |
def to_yaml | ( | self, | |
yaml_dump_kwargs = None |
|||
) |
Render the spec to YAML. Requires PyYAML to be installed. :param dict yaml_dump_kwargs: Additional keyword arguments to pass to `yaml.dump`
components |
openapi_version |
options |
plugins |
title |
version |