OpenQuizz
Une application de gestion des contenus pédagogiques
|
Data Structures | |
class | FieldConverterMixin |
Functions | |
def | make_type_list (types) |
def | make_min_max_attributes (validators, min_attr, max_attr) |
Variables | |
RegexType = type(re.compile("")) | |
dictionary | DEFAULT_FIELD_MAPPING |
Utilities for generating OpenAPI Specification (fka Swagger) entities from :class:`Fields <marshmallow.fields.Field>`. .. warning:: This module is treated as private API. Users should not need to use this module directly.
def apispec.ext.marshmallow.field_converter.make_min_max_attributes | ( | validators, | |
min_attr, | |||
max_attr | |||
) |
Return a dictionary of minimum and maximum attributes based on a list of validators. If either minimum or maximum values are not present in any of the validator objects that attribute will be omitted. :param validators list: A list of `Marshmallow` validator objects. Each objct is inspected for a minimum and maximum values :param min_attr string: The OpenAPI attribute for the minimum value :param max_attr string: The OpenAPI attribute for the maximum value
def apispec.ext.marshmallow.field_converter.make_type_list | ( | types | ) |
Return a list of types from a type attribute Since OpenAPI 3.1.0, "type" can be a single type as string or a list of types, including 'null'. This function takes a "type" attribute as input and returns it as a list, be it an empty or single-element list. This is useful to factorize type-conditional code or code adding a type.
dictionary DEFAULT_FIELD_MAPPING |
RegexType = type(re.compile("")) |