OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, plugins, openapi_version) |
def | to_dict (self) |
def | schema (self, name, component=None, **kwargs) |
def | response (self, component_id, component=None, **kwargs) |
def | parameter (self, component_id, location, component=None, **kwargs) |
def | header (self, component_id, component) |
def | example (self, name, component, **kwargs) |
def | security_scheme (self, component_id, component) |
Data Fields | |
openapi_version | |
schemas | |
responses | |
parameters | |
headers | |
examples | |
security_schemes | |
Stores OpenAPI components Components are top-level fields in OAS v2. They became sub-fields of "components" top-level field in OAS v3.
def __init__ | ( | self, | |
plugins, | |||
openapi_version | |||
) |
def example | ( | self, | |
name, | |||
component, | |||
** | kwargs | ||
) |
Add an example which can be referenced :param str name: identifier by which example may be referenced. :param dict component: example fields. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#exampleObject
def header | ( | self, | |
component_id, | |||
component | |||
) |
Add a header which can be referenced. :param str component_id: identifier by which header may be referenced. :param dict component: header fields. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#headerObject
def parameter | ( | self, | |
component_id, | |||
location, | |||
component = None , |
|||
** | kwargs | ||
) |
Add a parameter which can be referenced. :param str component_id: identifier by which parameter may be referenced. :param str location: location of the parameter. :param dict component: parameter fields. :param kwargs: plugin-specific arguments
def response | ( | self, | |
component_id, | |||
component = None , |
|||
** | kwargs | ||
) |
Add a response which can be referenced. :param str component_id: ref_id to use as reference :param dict component: response fields :param kwargs: plugin-specific arguments
def schema | ( | self, | |
name, | |||
component = None , |
|||
** | kwargs | ||
) |
Add a new schema to the spec. :param str name: identifier by which schema may be referenced. :param dict component: schema definition. .. note:: If you are using `apispec.ext.marshmallow`, you can pass fields' metadata as additional keyword arguments. For example, to add ``enum`` and ``description`` to your field: :: status = fields.String( required=True, metadata={ "description": "Status (open or closed)", "enum": ["open", "closed"], }, ) https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject
def security_scheme | ( | self, | |
component_id, | |||
component | |||
) |
Add a security scheme which can be referenced. :param str component_id: component_id to use as reference :param dict component: security scheme fields
def to_dict | ( | self | ) |
examples |
headers |
openapi_version |
parameters |
responses |
schemas |
security_schemes |