| 1 | """ |
| 2 | Marshmallow to Swagger Conversion |
| 3 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 4 | |
| 5 | Utilities for converting Marshmallow objects to their |
| 6 | corresponding Swagger representation. |
| 7 | |
| 8 | :copyright: Copyright 2018 PlanGrid, Inc., see AUTHORS. |
| 9 | :license: MIT, see LICENSE for details. |
| 10 | """ |
| 11 | import copyscip-python python python-stdlib 3.11 copy/__init__: |
| 12 | import inspectscip-python python python-stdlib 3.11 inspect/__init__: |
| 13 | import loggingscip-python python python-stdlib 3.11 logging/__init__: |
| 14 | import sysscip-python python python-stdlib 3.11 sys/__init__: |
| 15 | from collectionsscip-python python python-stdlib 3.11 collections/__init__: import namedtuplescip-python python python-stdlib 3.11 collections/namedtuple(). |
| 16 | from typingscip-python python python-stdlib 3.11 typing/__init__: import ( |
| 17 | overloadscip-python python python-stdlib 3.11 typing/overload()., |
| 18 | Anyscip-python python python-stdlib 3.11 typing/Any., |
| 19 | Callablescip-python python python-stdlib 3.11 typing/Callable., |
| 20 | Dictscip-python python python-stdlib 3.11 typing/Dict., |
| 21 | Genericscip-python python python-stdlib 3.11 typing/Generic., |
| 22 | Iterablescip-python python python-stdlib 3.11 typing/Iterable#, |
| 23 | Listscip-python python python-stdlib 3.11 typing/List., |
| 24 | Optionalscip-python python python-stdlib 3.11 typing/Optional., |
| 25 | Tuplescip-python python python-stdlib 3.11 typing/Tuple., |
| 26 | Typescip-python python python-stdlib 3.11 typing/Type., |
| 27 | TypeVarscip-python python python-stdlib 3.11 typing/TypeVar#, |
| 28 | Unionscip-python python python-stdlib 3.11 typing/Union., |
| 29 | ) |
| 30 | |
| 31 | if sysscip-python python python-stdlib 3.11 sys/__init__:.version_infoscip-python python python-stdlib 3.11 sys/version_info.version_info. >= (3, 10): |
| 32 | from typingscip-python python python-stdlib 3.11 typing/__init__: import ParamSpecscip-python python python-stdlib 3.11 typing/ParamSpec# |
| 33 | else: |
| 34 | from typing_extensionsscip-python python typing_extensions 4.15.0 typing_extensions/__init__: import ParamSpec |
| 35 | |
| 36 | import marshmallowscip-python python marshmallow 3.26.1 marshmallow/__init__: as m |
| 37 | from marshmallowscip-python python marshmallow 3.26.1 marshmallow/__init__: import Schema |
| 38 | from marshmallow.validatescip-python python marshmallow 3.26.1 `marshmallow.validate`/__init__: import Range |
| 39 | from marshmallow.validatescip-python python marshmallow 3.26.1 `marshmallow.validate`/__init__: import OneOf |
| 40 | from marshmallow.validatescip-python python marshmallow 3.26.1 `marshmallow.validate`/__init__: import ContainsOnly |
| 41 | from marshmallow.validatescip-python python marshmallow 3.26.1 `marshmallow.validate`/__init__: import Length |
| 42 | from marshmallow.validatescip-python python marshmallow 3.26.1 `marshmallow.validate`/__init__: import Validator |
| 43 | |
| 44 | from flask_rebarscip-python python flask-rebar 3.4.0 flask_rebar/__init__: import compatscip-python python flask-rebar 3.4.0 `flask_rebar.compat`/__init__: |
| 45 | from flask_rebar.authenticatorsscip-python python flask-rebar 3.4.0 `flask_rebar.authenticators`/__init__: import Authenticatorscip-python python flask-rebar 3.4.0 `flask_rebar.authenticators.base`/Authenticator# |
| 46 | from flask_rebar.validationscip-python python flask-rebar 3.4.0 `flask_rebar.validation`/__init__: import QueryParamListscip-python python flask-rebar 3.4.0 `flask_rebar.validation`/QueryParamList# |
| 47 | from flask_rebar.validationscip-python python flask-rebar 3.4.0 `flask_rebar.validation`/__init__: import CommaSeparatedListscip-python python flask-rebar 3.4.0 `flask_rebar.validation`/CommaSeparatedList# |
| 48 | from flask_rebar.swagger_generationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation`/__init__: import swagger_words as sw |
| 49 | |
| 50 | # for easier type hinting |
| 51 | MarshmallowObjectscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowObject. = Unionscip-python python python-stdlib 3.11 typing/Union.[Schema, m.fields.Field, Validator] |
| 52 | Tscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/T. = TypeVarscip-python python python-stdlib 3.11 typing/TypeVar#("T", boundscip-python python python-stdlib 3.11 typing/TypeVar#__init__().(bound)=MarshmallowObjectscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowObject.) |
| 53 | TFieldscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/TField. = TypeVarscip-python python python-stdlib 3.11 typing/TypeVar#("TField", boundscip-python python python-stdlib 3.11 typing/TypeVar#__init__().(bound)=m.fields.Field) |
| 54 | |
| 55 | # for type hinting decorators |
| 56 | Sscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/S. = TypeVarscip-python python python-stdlib 3.11 typing/TypeVar#("S") |
| 57 | Pscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/P. = ParamSpecscip-python python python-stdlib 3.11 typing/ParamSpec#("P") |
| 58 | |
| 59 | LoadDumpOptionsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LoadDumpOptions. = None |
| 60 | try: |
| 61 | EnumFieldscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumField.: Anyscip-python python python-stdlib 3.11 typing/Any. = m.fields.Enum |
| 62 | except AttributeErrorscip-python python python-stdlib 3.11 builtins/AttributeError#: |
| 63 | try: |
| 64 | from marshmallow_enumscip-python python flask-rebar 3.4.0 marshmallow_enum/__init__: import EnumFieldscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumField., LoadDumpOptionsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LoadDumpOptions. # type: ignore |
| 65 | except ImportErrorscip-python python python-stdlib 3.11 builtins/ImportError#: |
| 66 | EnumFieldscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumField. = None |
| 67 | |
| 68 | |
| 69 | # Special value to signify that a JSONSchema field should be left unset |
| 70 | class UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#: |
| 71 | pass |
| 72 | |
| 73 | |
| 74 | # We'll use this to mark methods as JSONSchema attribute setters |
| 75 | _method_markerscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_method_marker. = "__sets_jsonschema_attr__" |
| 76 | |
| 77 | # Holds attributes that we can pass around in these recursive |
| 78 | # calls to converters. Bit messy, but :shrug: |
| 79 | _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. = namedtuplescip-python python python-stdlib 3.11 collections/namedtuple().( |
| 80 | "_Context", |
| 81 | [ |
| 82 | # This will hold a reference to a convert method that can be used |
| 83 | # to make recursive calls |
| 84 | "convert", |
| 85 | # Only really using this for validators at the moment. It will hold the |
| 86 | # JSONSchema object that's been converter so far, so that the validator |
| 87 | # can be converted based on the type of the schema. |
| 88 | "memo", |
| 89 | # The current schema being converted. |
| 90 | "schema", |
| 91 | # The major version of OpenAPI being converter for |
| 92 | "openapi_version", |
| 93 | ], |
| 94 | ) |
| 95 | |
| 96 | |
| 97 | class UnregisteredTypescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UnregisteredType#(Exceptionscip-python python python-stdlib 3.11 builtins/Exception#): |
| 98 | pass |
| 99 | |
| 100 | |
| 101 | @overloadscip-python python python-stdlib 3.11 typing/overload(). |
| 102 | def _normalize_validatescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_normalize_validate().(validatescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_normalize_validate().(validate): None) -> None: |
| 103 | ... |
| 104 | |
| 105 | |
| 106 | @overloadscip-python python python-stdlib 3.11 typing/overload(). |
| 107 | def _normalize_validatescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_normalize_validate().( |
| 108 | validatescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_normalize_validate().(validate): Unionscip-python python python-stdlib 3.11 typing/Union.[Callablescip-python python python-stdlib 3.11 typing/Callable., Iterablescip-python python python-stdlib 3.11 typing/Iterable#[Callablescip-python python python-stdlib 3.11 typing/Callable.]] |
| 109 | ) -> Iterablescip-python python python-stdlib 3.11 typing/Iterable#[Callablescip-python python python-stdlib 3.11 typing/Callable.]: |
| 110 | ... |
| 111 | |
| 112 | |
| 113 | def _normalize_validatescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_normalize_validate().( |
| 114 | validatescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_normalize_validate().(validate): Optionalscip-python python python-stdlib 3.11 typing/Optional.[Unionscip-python python python-stdlib 3.11 typing/Union.[Callablescip-python python python-stdlib 3.11 typing/Callable., Iterablescip-python python python-stdlib 3.11 typing/Iterable#[Callablescip-python python python-stdlib 3.11 typing/Callable.]]] |
| 115 | ) -> Optionalscip-python python python-stdlib 3.11 typing/Optional.[Iterablescip-python python python-stdlib 3.11 typing/Iterable#[Callablescip-python python python-stdlib 3.11 typing/Callable.]]: |
| 116 | """ |
| 117 | Coerces the validate attribute on a Marshmallow field to a consistent type. |
| 118 | |
| 119 | The validate attribute on a Marshmallow field can either be a single |
| 120 | Validator or a collection of Validators. |
| 121 | |
| 122 | :param Validator|list[Validator] validate: |
| 123 | :rtype: list[Validator] |
| 124 | """ |
| 125 | if callable(validatescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_normalize_validate().(validate)): |
| 126 | return [validatescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_normalize_validate().(validate)] |
| 127 | else: |
| 128 | return validatescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_normalize_validate().(validate) |
| 129 | |
| 130 | |
| 131 | def get_swagger_titlescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/get_swagger_title().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/get_swagger_title().(obj): MarshmallowObjectscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowObject.) -> strscip-python python python-stdlib 3.11 builtins/str#: |
| 132 | """ |
| 133 | Gets a title for the given object. This title will be used |
| 134 | as a name/key for the object in swagger. |
| 135 | |
| 136 | :param obj: |
| 137 | :rtype: str |
| 138 | """ |
| 139 | if hasattr(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/get_swagger_title().(obj), "__swagger_title__"): |
| 140 | return objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/get_swagger_title().(obj).__swagger_title__ |
| 141 | elif hasattr(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/get_swagger_title().(obj), "__name__"): |
| 142 | return objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/get_swagger_title().(obj).__name__ |
| 143 | else: |
| 144 | return objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/get_swagger_title().(obj).__class__scip-python python python-stdlib 3.11 builtins/object#__class__()..__name__scip-python python python-stdlib 3.11 builtins/__name__# |
| 145 | |
| 146 | |
| 147 | def sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(attr): strscip-python python python-stdlib 3.11 builtins/str#) -> Callablescip-python python python-stdlib 3.11 typing/Callable.: |
| 148 | """ |
| 149 | Decorates a `MarshmallowConverter` method, marking it as an JSONSchema |
| 150 | attribute setter. |
| 151 | |
| 152 | Example usage:: |
| 153 | |
| 154 | class Converter(MarshmallowConverter): |
| 155 | MARSHMALLOW_TYPE = String() |
| 156 | |
| 157 | @sets_swagger_attr('type') |
| 158 | def get_type(obj, context): |
| 159 | return 'string' |
| 160 | |
| 161 | This converter receives instances of `String` and converts it to a |
| 162 | JSONSchema object that looks like `{'type': 'string'}`. |
| 163 | |
| 164 | :param str attr: The attribute to set |
| 165 | """ |
| 166 | |
| 167 | def wrapperscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().wrapper().(fscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().wrapper().(f): Callablescip-python python python-stdlib 3.11 typing/Callable.[Pscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/P., Tscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/T.]) -> Callablescip-python python python-stdlib 3.11 typing/Callable.[Pscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/P., Tscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/T.]: |
| 168 | setattr(fscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().wrapper().(f), _method_markerscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_method_marker., attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(attr)) |
| 169 | return fscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().wrapper().(f) |
| 170 | |
| 171 | return wrapperscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().wrapper(). |
| 172 | |
| 173 | |
| 174 | def get_schema_fieldsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/get_schema_fields().(schemascip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/get_schema_fields().(schema): Schema) -> Listscip-python python python-stdlib 3.11 typing/List.[Tuplescip-python python python-stdlib 3.11 typing/Tuple.[strscip-python python python-stdlib 3.11 builtins/str#, m.fields.Field]]: |
| 175 | """Retrieve all the names and field objects for a marshmallow Schema |
| 176 | |
| 177 | :param m.Schema schema: |
| 178 | :returns: Yields tuples of the field name and the field itself |
| 179 | :rtype: typing.Iterator[typing.Tuple[str, m.fields.Field]] |
| 180 | """ |
| 181 | fields: Listscip-python python python-stdlib 3.11 typing/List.[Tuplescip-python python python-stdlib 3.11 typing/Tuple.[strscip-python python python-stdlib 3.11 builtins/str#, m.fields.Field]] = [] |
| 182 | for name, field in schemascip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/get_schema_fields().(schema).fields.itemsscip-python python python-stdlib 3.11 builtins/dict#items().(): |
| 183 | prop = compatscip-python python flask-rebar 3.4.0 `flask_rebar.compat`/__init__:.get_data_keyscip-python python flask-rebar 3.4.0 `flask_rebar.compat`/get_data_key().(field) |
| 184 | fields.appendscip-python python python-stdlib 3.11 builtins/list#append().((prop, field)) |
| 185 | |
| 186 | # In Marshmallow 3.x, respect the 'ordered' Meta option for field ordering. |
| 187 | # When ordered=False (default), fields should be sorted alphabetically. |
| 188 | # In Marshmallow 4.0+, field order is always preserved (insertion order). |
| 189 | if not compatscip-python python flask-rebar 3.4.0 `flask_rebar.compat`/__init__:.is_schema_orderedscip-python python flask-rebar 3.4.0 `flask_rebar.compat`/is_schema_ordered().(schemascip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/get_schema_fields().(schema)): |
| 190 | fields.sortscip-python python python-stdlib 3.11 builtins/list#sort().() |
| 191 | return fields |
| 192 | |
| 193 | |
| 194 | class MarshmallowConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#(Genericscip-python python python-stdlib 3.11 typing/Generic.[Tscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/T.]): |
| 195 | """ |
| 196 | Abstract class for objects that convert Marshmallow objects to |
| 197 | JSONSchema dictionaries. |
| 198 | """ |
| 199 | |
| 200 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#MARSHMALLOW_TYPE.: Anyscip-python python python-stdlib 3.11 typing/Any. = None |
| 201 | |
| 202 | def convertscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#convert().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#convert().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#convert().(obj): Tscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/T., contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#convert().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> Dictscip-python python python-stdlib 3.11 typing/Dict.[strscip-python python python-stdlib 3.11 builtins/str#, Unionscip-python python python-stdlib 3.11 typing/Union.[strscip-python python python-stdlib 3.11 builtins/str#, boolscip-python python python-stdlib 3.11 builtins/bool#]]: |
| 203 | """ |
| 204 | Converts a Marshmallow object to a JSONSchema dictionary. |
| 205 | |
| 206 | This inspects the converter instance for methods that have been |
| 207 | marked as attribute setters, calling them to set attributes on the |
| 208 | resulting JSONSchema dictionary. |
| 209 | |
| 210 | :param m.Schema|m.fields.Field|Validator obj: |
| 211 | The Marshmallow object to be converted |
| 212 | :param _Context context: |
| 213 | Various information to help the converter understand how to |
| 214 | convert the object. |
| 215 | :rtype: dict |
| 216 | """ |
| 217 | jsonschema_obj = {} |
| 218 | |
| 219 | for _, method in inspectscip-python python python-stdlib 3.11 inspect/__init__:.getmembersscip-python python python-stdlib 3.11 inspect/getmembers().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#convert().(self), predicatescip-python python python-stdlib 3.11 inspect/getmembers().(predicate)=inspectscip-python python python-stdlib 3.11 inspect/__init__:.ismethodscip-python python python-stdlib 3.11 inspect/ismethod().): |
| 220 | if hasattr(method, _method_markerscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_method_marker.): |
| 221 | val = method(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#convert().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#convert().(context)) |
| 222 | if val is not UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#: |
| 223 | jsonschema_obj[getattrscip-python python python-stdlib 3.11 builtins/getattr().(method, _method_markerscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_method_marker.)] = val |
| 224 | |
| 225 | return jsonschema_obj |
| 226 | |
| 227 | |
| 228 | class SchemaConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#(MarshmallowConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#[Schema]): |
| 229 | """Converts Marshmallow Schema objects.""" |
| 230 | |
| 231 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#MARSHMALLOW_TYPE. = m.Schema |
| 232 | |
| 233 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.) |
| 234 | def get_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_type().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_type().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_type().(obj): Schema, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_type().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> strscip-python python python-stdlib 3.11 builtins/str#: |
| 235 | if objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_type().(obj).many: |
| 236 | return sw.arrayscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/array.array. |
| 237 | else: |
| 238 | return sw.object_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/object_.object_. |
| 239 | |
| 240 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.itemsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/items.items.) |
| 241 | def get_itemsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_items().( |
| 242 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_items().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_items().(obj): Schema, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_items().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 243 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], MarshmallowObjectscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowObject.]: |
| 244 | if not objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_items().(obj).many: |
| 245 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 246 | |
| 247 | singular_obj = copyscip-python python python-stdlib 3.11 copy/__init__:.deepcopyscip-python python python-stdlib 3.11 copy/deepcopy().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_items().(obj)) |
| 248 | singular_obj.many = False |
| 249 | |
| 250 | return contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_items().(context).convertscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/(singular_obj, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_items().(context)) |
| 251 | |
| 252 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.propertiesscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/properties.properties.) |
| 253 | def get_propertiesscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_properties().( |
| 254 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_properties().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_properties().(obj): Schema, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_properties().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 255 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], Dictscip-python python python-stdlib 3.11 typing/Dict.[strscip-python python python-stdlib 3.11 builtins/str#, Anyscip-python python python-stdlib 3.11 typing/Any.]]: |
| 256 | if objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_properties().(obj).many: |
| 257 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 258 | |
| 259 | properties = {} |
| 260 | |
| 261 | for prop, field in get_schema_fieldsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/get_schema_fields().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_properties().(obj)): |
| 262 | properties[prop] = contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_properties().(context).convertscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/(field, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_properties().(context)) |
| 263 | |
| 264 | return properties |
| 265 | |
| 266 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.requiredscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/required.required.) |
| 267 | def get_requiredscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_required().( |
| 268 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_required().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_required().(obj): Schema, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_required().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 269 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]]: |
| 270 | if objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_required().(obj).many or objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_required().(obj).partial is True: |
| 271 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 272 | |
| 273 | required: Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#] = [] |
| 274 | obj_partial_is_collection = m.utils.is_collection(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_required().(obj).partial) |
| 275 | |
| 276 | for name, field in objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_required().(obj).fields.itemsscip-python python python-stdlib 3.11 builtins/dict#items().(): |
| 277 | if field.required: |
| 278 | prop = compatscip-python python flask-rebar 3.4.0 `flask_rebar.compat`/__init__:.get_data_keyscip-python python flask-rebar 3.4.0 `flask_rebar.compat`/get_data_key().(field) |
| 279 | if obj_partial_is_collection and objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_required().(obj).partial and prop in objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_required().(obj).partial: |
| 280 | continue |
| 281 | required.appendscip-python python python-stdlib 3.11 builtins/list#append().(prop) |
| 282 | |
| 283 | if not required: |
| 284 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 285 | |
| 286 | if not compatscip-python python flask-rebar 3.4.0 `flask_rebar.compat`/__init__:.is_schema_orderedscip-python python flask-rebar 3.4.0 `flask_rebar.compat`/is_schema_ordered().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_required().(obj)): |
| 287 | required.sortscip-python python python-stdlib 3.11 builtins/list#sort().() |
| 288 | return required |
| 289 | |
| 290 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.descriptionscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/description.description.) |
| 291 | def get_descriptionscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_description().( |
| 292 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_description().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_description().(obj): Schema, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_description().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 293 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], strscip-python python python-stdlib 3.11 builtins/str#]: |
| 294 | if objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_description().(obj).many: |
| 295 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 296 | elif objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_description().(obj).__doc__: |
| 297 | return objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_description().(obj).__doc__ |
| 298 | else: |
| 299 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 300 | |
| 301 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.titlescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/title.title.) |
| 302 | def get_titlescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_title().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_title().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_title().(obj): Schema, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_title().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], strscip-python python python-stdlib 3.11 builtins/str#]: |
| 303 | if not objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_title().(obj).many: |
| 304 | return get_swagger_titlescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/get_swagger_title().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_title().(obj)) |
| 305 | else: |
| 306 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 307 | |
| 308 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.additional_propertiesscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/additional_properties.additional_properties.) |
| 309 | def get_additional_propertiesscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_additional_properties().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_additional_properties().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_additional_properties().(obj): Schema, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_additional_properties().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> boolscip-python python python-stdlib 3.11 builtins/bool#: |
| 310 | if objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_additional_properties().(obj).unknown in (m.RAISE, m.EXCLUDE): |
| 311 | return False |
| 312 | elif objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_additional_properties().(obj).unknown is m.INCLUDE: |
| 313 | return True |
| 314 | else: |
| 315 | raise ValueErrorscip-python python python-stdlib 3.11 builtins/ValueError#( |
| 316 | f"Unexpected Schema.unknown value {objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_additional_properties().(obj).unknown} for {objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#get_additional_properties().(obj)} " |
| 317 | ) |
| 318 | |
| 319 | |
| 320 | class FieldConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#(MarshmallowConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#, Genericscip-python python python-stdlib 3.11 typing/Generic.[TFieldscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/TField.]): |
| 321 | """ |
| 322 | Base Converter for Marshmallow Field objects. |
| 323 | |
| 324 | This should be extended for specific Field types. |
| 325 | """ |
| 326 | |
| 327 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#MARSHMALLOW_TYPE.: Typescip-python python python-stdlib 3.11 typing/Type.[m.fields.Field] = m.fields.Field |
| 328 | |
| 329 | def convertscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#convert().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#convert().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#convert().(obj): TFieldscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/TField., contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#convert().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> Dictscip-python python python-stdlib 3.11 typing/Dict.[strscip-python python python-stdlib 3.11 builtins/str#, Unionscip-python python python-stdlib 3.11 typing/Union.[strscip-python python python-stdlib 3.11 builtins/str#, boolscip-python python python-stdlib 3.11 builtins/bool#]]: |
| 330 | jsonschema_obj = superscip-python python python-stdlib 3.11 builtins/super#().convertscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#convert().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#convert().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#convert().(context)) |
| 331 | |
| 332 | if objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#convert().(obj).dump_only: |
| 333 | jsonschema_obj["readOnly"] = True |
| 334 | |
| 335 | if objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#convert().(obj).validate: |
| 336 | validators = _normalize_validatescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_normalize_validate().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#convert().(obj).validate) |
| 337 | for validator in validators: |
| 338 | try: |
| 339 | jsonschema_obj.updatescip-python python python-stdlib 3.11 typing/MutableMapping#update().( |
| 340 | contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#convert().(context).convertscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/( |
| 341 | obj=validator, |
| 342 | context=_Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.( |
| 343 | convert=contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#convert().(context).convertscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/, |
| 344 | memo=jsonschema_obj, |
| 345 | schema=contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#convert().(context).schemascip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/, |
| 346 | openapi_version=contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#convert().(context).openapi_versionscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/, |
| 347 | ), |
| 348 | ) |
| 349 | ) |
| 350 | except UnregisteredTypescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UnregisteredType# as e: |
| 351 | loggingscip-python python python-stdlib 3.11 logging/__init__:.debugscip-python python python-stdlib 3.11 logging/debug().( |
| 352 | "Unable to convert validator {validator}: {err}".format( |
| 353 | validator=validator, err=e |
| 354 | ) |
| 355 | ) |
| 356 | |
| 357 | return jsonschema_obj |
| 358 | |
| 359 | # With OpenApi 3.1 nullable has been removed entirely |
| 360 | # and allowing 'none' means we return an array of allowed types that includes sw.null |
| 361 | def null_type_determinationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().( |
| 362 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(obj): TFieldscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/TField., contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context., sw_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(sw_type): strscip-python python python-stdlib 3.11 builtins/str# |
| 363 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[strscip-python python python-stdlib 3.11 builtins/str#, Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]]: |
| 364 | if contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(context).openapi_versionscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ == 3 and objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(obj).allow_none: |
| 365 | return [sw_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(sw_type), sw.nullscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/null.null.] |
| 366 | else: |
| 367 | return sw_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(sw_type) |
| 368 | |
| 369 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.defaultscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/default.default.) |
| 370 | def get_defaultscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_default().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_default().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_default().(obj): TFieldscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/TField., contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_default().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> Anyscip-python python python-stdlib 3.11 typing/Any.: |
| 371 | if ( |
| 372 | objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_default().(obj).load_default is not m.missing |
| 373 | # Marshmallow accepts a callable for the default. This is tricky |
| 374 | # to handle, so let's just ignore this for now. |
| 375 | and not callable(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_default().(obj).load_default) |
| 376 | ): |
| 377 | return objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_default().(obj).load_default |
| 378 | else: |
| 379 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 380 | |
| 381 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.nullablescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/nullable.nullable.) |
| 382 | def get_nullablescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_nullable().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_nullable().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_nullable().(obj): TFieldscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/TField., contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_nullable().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], boolscip-python python python-stdlib 3.11 builtins/bool#]: |
| 383 | if contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_nullable().(context).openapi_versionscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ == 2 and objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_nullable().(obj).allow_none is not False: |
| 384 | return True |
| 385 | else: |
| 386 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 387 | |
| 388 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.descriptionscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/description.description.) |
| 389 | def get_descriptionscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_description().( |
| 390 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_description().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_description().(obj): TFieldscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/TField., contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_description().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 391 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], strscip-python python python-stdlib 3.11 builtins/str#]: |
| 392 | if "description" in objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_description().(obj).metadata: |
| 393 | return objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#get_description().(obj).metadata["description"] |
| 394 | else: |
| 395 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 396 | |
| 397 | |
| 398 | class ValidatorConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ValidatorConverter#(MarshmallowConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#[Validator]): |
| 399 | """ |
| 400 | Base Converter for Marshmallow Validator objects. |
| 401 | |
| 402 | This should be extended for specific Validator types. |
| 403 | """ |
| 404 | |
| 405 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ValidatorConverter#MARSHMALLOW_TYPE.: Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[Validator], Typescip-python python python-stdlib 3.11 typing/Type.[OneOf]] = Validator |
| 406 | |
| 407 | |
| 408 | class NestedConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NestedConverter#(FieldConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#[m.fields.Nested]): |
| 409 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NestedConverter#MARSHMALLOW_TYPE. = m.fields.Nested |
| 410 | |
| 411 | def convertscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NestedConverter#convert().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NestedConverter#convert().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NestedConverter#convert().(obj): m.fields.Nested, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NestedConverter#convert().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> Dictscip-python python python-stdlib 3.11 typing/Dict.[strscip-python python python-stdlib 3.11 builtins/str#, Anyscip-python python python-stdlib 3.11 typing/Any.]: |
| 412 | return contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NestedConverter#convert().(context).convertscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NestedConverter#convert().(obj).schema, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NestedConverter#convert().(context)) |
| 413 | |
| 414 | |
| 415 | class ListConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#(FieldConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#[m.fields.List]): |
| 416 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#MARSHMALLOW_TYPE. = m.fields.List |
| 417 | |
| 418 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.) |
| 419 | def get_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#get_type().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#get_type().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#get_type().(obj): m.fields.List, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#get_type().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> Unionscip-python python python-stdlib 3.11 typing/Union.[strscip-python python python-stdlib 3.11 builtins/str#, Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]]: |
| 420 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#get_type().(self).null_type_determinationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#get_type().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#get_type().(context), sw.arrayscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/array.array.) |
| 421 | |
| 422 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.itemsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/items.items.) |
| 423 | def get_itemsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#get_items().( |
| 424 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#get_items().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#get_items().(obj): m.fields.List, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#get_items().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 425 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], m.fields.List]: |
| 426 | return contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#get_items().(context).convertscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#get_items().(obj).inner, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#get_items().(context)) |
| 427 | |
| 428 | |
| 429 | class DictConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#(FieldConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#[m.fields.Dict]): |
| 430 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#MARSHMALLOW_TYPE. = m.fields.Dict |
| 431 | |
| 432 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.) |
| 433 | def get_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#get_type().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#get_type().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#get_type().(obj): m.fields.Dict, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#get_type().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> Unionscip-python python python-stdlib 3.11 typing/Union.[strscip-python python python-stdlib 3.11 builtins/str#, Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]]: |
| 434 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#get_type().(self).null_type_determinationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#get_type().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#get_type().(context), sw.object_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/object_.object_.) |
| 435 | |
| 436 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.additional_propertiesscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/additional_properties.additional_properties.) |
| 437 | def get_additional_propertiesscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#get_additional_properties().( |
| 438 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#get_additional_properties().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#get_additional_properties().(obj): m.fields.Dict, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#get_additional_properties().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 439 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], m.fields.Dict]: |
| 440 | if objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#get_additional_properties().(obj).value_field: |
| 441 | return contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#get_additional_properties().(context).convertscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#get_additional_properties().(obj).value_field, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#get_additional_properties().(context)) |
| 442 | else: |
| 443 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 444 | |
| 445 | |
| 446 | class IntegerConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/IntegerConverter#(FieldConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#[m.fields.Integer]): |
| 447 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/IntegerConverter#MARSHMALLOW_TYPE. = m.fields.Integer |
| 448 | |
| 449 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.) |
| 450 | def get_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/IntegerConverter#get_type().( |
| 451 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/IntegerConverter#get_type().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/IntegerConverter#get_type().(obj): m.fields.Integer, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/IntegerConverter#get_type().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 452 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[strscip-python python python-stdlib 3.11 builtins/str#, Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]]: |
| 453 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/IntegerConverter#get_type().(self).null_type_determinationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/IntegerConverter#get_type().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/IntegerConverter#get_type().(context), sw.integerscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/integer.integer.) |
| 454 | |
| 455 | |
| 456 | class StringConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/StringConverter#(FieldConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#[m.fields.String]): |
| 457 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/StringConverter#MARSHMALLOW_TYPE. = m.fields.String |
| 458 | |
| 459 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.) |
| 460 | def get_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/StringConverter#get_type().( |
| 461 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/StringConverter#get_type().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/StringConverter#get_type().(obj): m.fields.String, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/StringConverter#get_type().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 462 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[strscip-python python python-stdlib 3.11 builtins/str#, Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]]: |
| 463 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/StringConverter#get_type().(self).null_type_determinationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/StringConverter#get_type().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/StringConverter#get_type().(context), sw.stringscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/string.string.) |
| 464 | |
| 465 | |
| 466 | class NumberConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NumberConverter#(FieldConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#[m.fields.Number]): |
| 467 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NumberConverter#MARSHMALLOW_TYPE. = m.fields.Number |
| 468 | |
| 469 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.) |
| 470 | def get_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NumberConverter#get_type().( |
| 471 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NumberConverter#get_type().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NumberConverter#get_type().(obj): m.fields.Number, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NumberConverter#get_type().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 472 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[strscip-python python python-stdlib 3.11 builtins/str#, Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]]: |
| 473 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NumberConverter#get_type().(self).null_type_determinationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NumberConverter#get_type().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NumberConverter#get_type().(context), sw.numberscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/number.number.) |
| 474 | |
| 475 | |
| 476 | class BooleanConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/BooleanConverter#(FieldConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#[m.fields.Boolean]): |
| 477 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/BooleanConverter#MARSHMALLOW_TYPE. = m.fields.Boolean |
| 478 | |
| 479 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.) |
| 480 | def get_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/BooleanConverter#get_type().( |
| 481 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/BooleanConverter#get_type().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/BooleanConverter#get_type().(obj): m.fields.Boolean, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/BooleanConverter#get_type().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 482 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[strscip-python python python-stdlib 3.11 builtins/str#, Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]]: |
| 483 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/BooleanConverter#get_type().(self).null_type_determinationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/BooleanConverter#get_type().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/BooleanConverter#get_type().(context), sw.booleanscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/boolean.boolean.) |
| 484 | |
| 485 | |
| 486 | class DateTimeConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateTimeConverter#(FieldConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#[m.fields.DateTime]): |
| 487 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateTimeConverter#MARSHMALLOW_TYPE. = m.fields.DateTime |
| 488 | |
| 489 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.) |
| 490 | def get_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateTimeConverter#get_type().( |
| 491 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateTimeConverter#get_type().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateTimeConverter#get_type().(obj): m.fields.DateTime, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateTimeConverter#get_type().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 492 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[strscip-python python python-stdlib 3.11 builtins/str#, Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]]: |
| 493 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateTimeConverter#get_type().(self).null_type_determinationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateTimeConverter#get_type().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateTimeConverter#get_type().(context), sw.stringscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/string.string.) |
| 494 | |
| 495 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.format_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/format_.format_.) |
| 496 | def get_formatscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateTimeConverter#get_format().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateTimeConverter#get_format().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateTimeConverter#get_format().(obj): m.fields.DateTime, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateTimeConverter#get_format().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> strscip-python python python-stdlib 3.11 builtins/str#: |
| 497 | return sw.date_timescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/date_time.date_time. |
| 498 | |
| 499 | |
| 500 | class UUIDConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UUIDConverter#(FieldConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#[m.fields.UUID]): |
| 501 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UUIDConverter#MARSHMALLOW_TYPE. = m.fields.UUID |
| 502 | |
| 503 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.) |
| 504 | def get_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UUIDConverter#get_type().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UUIDConverter#get_type().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UUIDConverter#get_type().(obj): m.fields.UUID, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UUIDConverter#get_type().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> Unionscip-python python python-stdlib 3.11 typing/Union.[strscip-python python python-stdlib 3.11 builtins/str#, Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]]: |
| 505 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UUIDConverter#get_type().(self).null_type_determinationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UUIDConverter#get_type().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UUIDConverter#get_type().(context), sw.stringscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/string.string.) |
| 506 | |
| 507 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.format_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/format_.format_.) |
| 508 | def get_formatscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UUIDConverter#get_format().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UUIDConverter#get_format().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UUIDConverter#get_format().(obj): m.fields.UUID, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UUIDConverter#get_format().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> strscip-python python python-stdlib 3.11 builtins/str#: |
| 509 | return sw.uuidscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/uuid.uuid. |
| 510 | |
| 511 | |
| 512 | class DateConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateConverter#(FieldConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#[m.fields.Date]): |
| 513 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateConverter#MARSHMALLOW_TYPE. = m.fields.Date |
| 514 | |
| 515 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.) |
| 516 | def get_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateConverter#get_type().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateConverter#get_type().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateConverter#get_type().(obj): m.fields.Date, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateConverter#get_type().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> Unionscip-python python python-stdlib 3.11 typing/Union.[strscip-python python python-stdlib 3.11 builtins/str#, Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]]: |
| 517 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateConverter#get_type().(self).null_type_determinationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateConverter#get_type().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateConverter#get_type().(context), sw.stringscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/string.string.) |
| 518 | |
| 519 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.format_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/format_.format_.) |
| 520 | def get_formatscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateConverter#get_format().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateConverter#get_format().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateConverter#get_format().(obj): m.fields.Date, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateConverter#get_format().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> strscip-python python python-stdlib 3.11 builtins/str#: |
| 521 | return sw.datescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/date.date. |
| 522 | |
| 523 | |
| 524 | class MethodConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MethodConverter#(FieldConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#[m.fields.Method]): |
| 525 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MethodConverter#MARSHMALLOW_TYPE. = m.fields.Method |
| 526 | |
| 527 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.) |
| 528 | def get_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MethodConverter#get_type().( |
| 529 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MethodConverter#get_type().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MethodConverter#get_type().(obj): m.fields.Method, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MethodConverter#get_type().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 530 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[strscip-python python python-stdlib 3.11 builtins/str#, Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]]: |
| 531 | if "swagger_type" in objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MethodConverter#get_type().(obj).metadata: |
| 532 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MethodConverter#get_type().(self).null_type_determinationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().( |
| 533 | objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MethodConverter#get_type().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MethodConverter#get_type().(context), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MethodConverter#get_type().(obj).metadata["swagger_type"] |
| 534 | ) |
| 535 | else: |
| 536 | raise ValueErrorscip-python python python-stdlib 3.11 builtins/ValueError#( |
| 537 | 'Must include "swagger_type" ' "keyword argument in Method field" |
| 538 | ) |
| 539 | |
| 540 | |
| 541 | class FunctionConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FunctionConverter#(FieldConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#[m.fields.Function]): |
| 542 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FunctionConverter#MARSHMALLOW_TYPE. = m.fields.Function |
| 543 | |
| 544 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.) |
| 545 | def get_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FunctionConverter#get_type().( |
| 546 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FunctionConverter#get_type().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FunctionConverter#get_type().(obj): m.fields.Function, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FunctionConverter#get_type().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 547 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[strscip-python python python-stdlib 3.11 builtins/str#, Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]]: |
| 548 | if "swagger_type" in objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FunctionConverter#get_type().(obj).metadata: |
| 549 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FunctionConverter#get_type().(self).null_type_determinationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().( |
| 550 | objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FunctionConverter#get_type().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FunctionConverter#get_type().(context), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FunctionConverter#get_type().(obj).metadata["swagger_type"] |
| 551 | ) |
| 552 | else: |
| 553 | raise ValueErrorscip-python python python-stdlib 3.11 builtins/ValueError#( |
| 554 | 'Must include "swagger_type" ' "keyword argument in Function field" |
| 555 | ) |
| 556 | |
| 557 | |
| 558 | class ConstantConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConstantConverter#(FieldConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#[m.fields.Constant]): |
| 559 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConstantConverter#MARSHMALLOW_TYPE. = m.fields.Constant |
| 560 | |
| 561 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.enumscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/enum.enum.) |
| 562 | def get_enumscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConstantConverter#get_enum().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConstantConverter#get_enum().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConstantConverter#get_enum().(obj): m.fields.Constant, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConstantConverter#get_enum().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]: |
| 563 | return [objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConstantConverter#get_enum().(obj).constant] |
| 564 | |
| 565 | |
| 566 | class CsvArrayConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#(ListConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#): |
| 567 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#MARSHMALLOW_TYPE. = CommaSeparatedListscip-python python flask-rebar 3.4.0 `flask_rebar.validation`/CommaSeparatedList# |
| 568 | |
| 569 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.collection_formatscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/collection_format.collection_format.) |
| 570 | def get_collection_formatscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#get_collection_format().( |
| 571 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#get_collection_format().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#get_collection_format().(obj): CommaSeparatedListscip-python python flask-rebar 3.4.0 `flask_rebar.validation`/CommaSeparatedList#, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#get_collection_format().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 572 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], strscip-python python python-stdlib 3.11 builtins/str#]: |
| 573 | return sw.csvscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/csv.csv. if contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#get_collection_format().(context).openapi_versionscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ == 2 else UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 574 | |
| 575 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.stylescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/style.style.) |
| 576 | def get_stylescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#get_style().( |
| 577 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#get_style().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#get_style().(obj): CommaSeparatedListscip-python python flask-rebar 3.4.0 `flask_rebar.validation`/CommaSeparatedList#, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#get_style().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 578 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], strscip-python python python-stdlib 3.11 builtins/str#]: |
| 579 | return sw.formscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/form.form. if contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#get_style().(context).openapi_versionscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ == 3 else UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 580 | |
| 581 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.explodescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/explode.explode.) |
| 582 | def get_explodescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#get_explode().( |
| 583 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#get_explode().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#get_explode().(obj): CommaSeparatedListscip-python python flask-rebar 3.4.0 `flask_rebar.validation`/CommaSeparatedList#, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#get_explode().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 584 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], boolscip-python python python-stdlib 3.11 builtins/bool#]: |
| 585 | return False if contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#get_explode().(context).openapi_versionscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ == 3 else UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 586 | |
| 587 | |
| 588 | class MultiArrayConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MultiArrayConverter#(ListConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#): |
| 589 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MultiArrayConverter#MARSHMALLOW_TYPE. = QueryParamListscip-python python flask-rebar 3.4.0 `flask_rebar.validation`/QueryParamList# |
| 590 | |
| 591 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.collection_formatscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/collection_format.collection_format.) |
| 592 | def get_collection_formatscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MultiArrayConverter#get_collection_format().( |
| 593 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MultiArrayConverter#get_collection_format().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MultiArrayConverter#get_collection_format().(obj): QueryParamListscip-python python flask-rebar 3.4.0 `flask_rebar.validation`/QueryParamList#, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MultiArrayConverter#get_collection_format().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 594 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], strscip-python python python-stdlib 3.11 builtins/str#]: |
| 595 | return sw.multiscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/multi.multi. if contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MultiArrayConverter#get_collection_format().(context).openapi_versionscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ == 2 else UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 596 | |
| 597 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.explodescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/explode.explode.) |
| 598 | def get_explodescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MultiArrayConverter#get_explode().( |
| 599 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MultiArrayConverter#get_explode().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MultiArrayConverter#get_explode().(obj): QueryParamListscip-python python flask-rebar 3.4.0 `flask_rebar.validation`/QueryParamList#, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MultiArrayConverter#get_explode().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 600 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], boolscip-python python python-stdlib 3.11 builtins/bool#]: |
| 601 | return True if contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MultiArrayConverter#get_explode().(context).openapi_versionscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ == 3 else UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 602 | |
| 603 | |
| 604 | class RangeConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/RangeConverter#(ValidatorConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ValidatorConverter#): |
| 605 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/RangeConverter#MARSHMALLOW_TYPE. = Range |
| 606 | |
| 607 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.minimumscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/minimum.minimum.) |
| 608 | def get_minimumscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/RangeConverter#get_minimum().( |
| 609 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/RangeConverter#get_minimum().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/RangeConverter#get_minimum().(obj): Range, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/RangeConverter#get_minimum().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 610 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], intscip-python python python-stdlib 3.11 builtins/int#, floatscip-python python python-stdlib 3.11 builtins/float#]: |
| 611 | if objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/RangeConverter#get_minimum().(obj).min is not None: |
| 612 | return objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/RangeConverter#get_minimum().(obj).min |
| 613 | else: |
| 614 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 615 | |
| 616 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.maximumscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/maximum.maximum.) |
| 617 | def get_maximumscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/RangeConverter#get_maximum().( |
| 618 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/RangeConverter#get_maximum().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/RangeConverter#get_maximum().(obj): Range, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/RangeConverter#get_maximum().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 619 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], intscip-python python python-stdlib 3.11 builtins/int#, floatscip-python python python-stdlib 3.11 builtins/float#]: |
| 620 | if objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/RangeConverter#get_maximum().(obj).max is not None: |
| 621 | return objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/RangeConverter#get_maximum().(obj).max |
| 622 | else: |
| 623 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 624 | |
| 625 | |
| 626 | class ContainsOnlyConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ContainsOnlyConverter#(ValidatorConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ValidatorConverter#): |
| 627 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ContainsOnlyConverter#MARSHMALLOW_TYPE. = ContainsOnly |
| 628 | |
| 629 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.itemsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/items.items.) |
| 630 | def get_itemsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ContainsOnlyConverter#get_items().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ContainsOnlyConverter#get_items().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ContainsOnlyConverter#get_items().(obj): ContainsOnly, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ContainsOnlyConverter#get_items().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> Dictscip-python python python-stdlib 3.11 typing/Dict.[strscip-python python python-stdlib 3.11 builtins/str#, Anyscip-python python python-stdlib 3.11 typing/Any.]: |
| 631 | return {"type": contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ContainsOnlyConverter#get_items().(context).memoscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/["items"]["type"], "enum": objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ContainsOnlyConverter#get_items().(obj).choices} |
| 632 | |
| 633 | |
| 634 | class OneOfConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/OneOfConverter#(ValidatorConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ValidatorConverter#): |
| 635 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/OneOfConverter#MARSHMALLOW_TYPE. = OneOf |
| 636 | |
| 637 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.enumscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/enum.enum.) |
| 638 | def get_enumscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/OneOfConverter#get_enum().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/OneOfConverter#get_enum().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/OneOfConverter#get_enum().(obj): OneOf, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/OneOfConverter#get_enum().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]: |
| 639 | return listscip-python python python-stdlib 3.11 builtins/list#(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/OneOfConverter#get_enum().(obj).choices) |
| 640 | |
| 641 | |
| 642 | class LengthConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#(ValidatorConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ValidatorConverter#): |
| 643 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#MARSHMALLOW_TYPE. = Length |
| 644 | |
| 645 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.min_itemsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/min_items.min_items.) |
| 646 | def get_minimum_itemsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_minimum_items().( |
| 647 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_minimum_items().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_minimum_items().(obj): Length, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_minimum_items().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 648 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], intscip-python python python-stdlib 3.11 builtins/int#]: |
| 649 | if contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_minimum_items().(context).memoscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/[sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.] == sw.arrayscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/array.array.: |
| 650 | if objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_minimum_items().(obj).min is not None: |
| 651 | return objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_minimum_items().(obj).min |
| 652 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 653 | |
| 654 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.max_itemsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/max_items.max_items.) |
| 655 | def get_maximum_itemsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_maximum_items().( |
| 656 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_maximum_items().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_maximum_items().(obj): Length, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_maximum_items().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 657 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], intscip-python python python-stdlib 3.11 builtins/int#]: |
| 658 | if contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_maximum_items().(context).memoscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/[sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.] == sw.arrayscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/array.array.: |
| 659 | if objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_maximum_items().(obj).max is not None: |
| 660 | return objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_maximum_items().(obj).max |
| 661 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 662 | |
| 663 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.min_lengthscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/min_length.min_length.) |
| 664 | def get_minimum_lengthscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_minimum_length().( |
| 665 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_minimum_length().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_minimum_length().(obj): Length, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_minimum_length().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 666 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], intscip-python python python-stdlib 3.11 builtins/int#]: |
| 667 | if contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_minimum_length().(context).memoscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/[sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.] == sw.stringscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/string.string.: |
| 668 | if objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_minimum_length().(obj).min is not None: |
| 669 | return objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_minimum_length().(obj).min |
| 670 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 671 | |
| 672 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.max_lengthscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/max_length.max_length.) |
| 673 | def get_maximum_lengthscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_maximum_length().( |
| 674 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_maximum_length().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_maximum_length().(obj): Length, contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_maximum_length().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 675 | ) -> Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET#], intscip-python python python-stdlib 3.11 builtins/int#]: |
| 676 | if contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_maximum_length().(context).memoscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/[sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.] == sw.stringscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/string.string.: |
| 677 | if objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_maximum_length().(obj).max is not None: |
| 678 | return objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#get_maximum_length().(obj).max |
| 679 | return UNSETscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UNSET# |
| 680 | |
| 681 | |
| 682 | class ConverterRegistryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#: |
| 683 | """ |
| 684 | Registry for MarshmallowConverters. |
| 685 | |
| 686 | Schemas for responses, query strings, request bodies, etc. need to |
| 687 | be converted differently. For example, response schemas as "dump"ed and |
| 688 | request body schemas are "loaded". For another example, query strings |
| 689 | don't support nesting. |
| 690 | |
| 691 | This registry also allows for additional converters to be added for custom |
| 692 | Marshmallow types. |
| 693 | """ |
| 694 | |
| 695 | def __init__scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#__init__().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#__init__().(self)) -> None: |
| 696 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#__init__().(self)._type_mapscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_type_map.: Dictscip-python python python-stdlib 3.11 typing/Dict.[ |
| 697 | Unionscip-python python python-stdlib 3.11 typing/Union.[Typescip-python python python-stdlib 3.11 typing/Type.[MarshmallowObjectscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowObject.], Typescip-python python python-stdlib 3.11 typing/Type.[Authenticatorscip-python python flask-rebar 3.4.0 `flask_rebar.authenticators.base`/Authenticator#]], MarshmallowConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter# |
| 698 | ] = {} |
| 699 | # self._validator_map = {} |
| 700 | |
| 701 | def register_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#register_type().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#register_type().(self), converterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#register_type().(converter): MarshmallowConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#) -> None: |
| 702 | """ |
| 703 | Registers a converter. |
| 704 | |
| 705 | :param MarshmallowConverter converter: |
| 706 | """ |
| 707 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#register_type().(self)._type_mapscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_type_map.[converterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#register_type().(converter).MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#MARSHMALLOW_TYPE.] = converterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#register_type().(converter) |
| 708 | |
| 709 | def register_typesscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#register_types().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#register_types().(self), convertersscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#register_types().(converters): Iterablescip-python python python-stdlib 3.11 typing/Iterable#[MarshmallowConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#]) -> None: |
| 710 | """ |
| 711 | Registers multiple converters. |
| 712 | |
| 713 | :param iterable[MarshmallowConverter] converters: |
| 714 | """ |
| 715 | for converter in convertersscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#register_types().(converters): |
| 716 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#register_types().(self).register_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#register_type().(converter) |
| 717 | |
| 718 | def _get_converter_for_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_get_converter_for_type().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_get_converter_for_type().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_get_converter_for_type().(obj): MarshmallowObjectscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowObject.) -> MarshmallowConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#: |
| 719 | """ |
| 720 | Locates the registered converter for a given type. |
| 721 | :param obj: instance to convert |
| 722 | :return: converter for type of instance |
| 723 | """ |
| 724 | method_resolution_order = objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_get_converter_for_type().(obj).__class__scip-python python python-stdlib 3.11 builtins/object#__class__()..__mro__scip-python python python-stdlib 3.11 builtins/type#__mro__(). |
| 725 | |
| 726 | for cls in method_resolution_order: |
| 727 | if cls in selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_get_converter_for_type().(self)._type_mapscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_type_map.: |
| 728 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_get_converter_for_type().(self)._type_mapscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_type_map.[cls] |
| 729 | else: |
| 730 | raise UnregisteredTypescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UnregisteredType#( |
| 731 | "No registered type found in method resolution order: {mro}\n" |
| 732 | "Registered types: {types}".format( |
| 733 | mro=method_resolution_order, types=listscip-python python python-stdlib 3.11 builtins/list#(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_get_converter_for_type().(self)._type_mapscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_type_map..keysscip-python python python-stdlib 3.11 builtins/dict#keys().()) |
| 734 | ) |
| 735 | ) |
| 736 | |
| 737 | def _convertscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_convert().( |
| 738 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_convert().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_convert().(obj): MarshmallowObjectscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowObject., contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_convert().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context. |
| 739 | ) -> Dictscip-python python python-stdlib 3.11 typing/Dict.[strscip-python python python-stdlib 3.11 builtins/str#, Unionscip-python python python-stdlib 3.11 typing/Union.[strscip-python python python-stdlib 3.11 builtins/str#, boolscip-python python python-stdlib 3.11 builtins/bool#]]: |
| 740 | """ |
| 741 | Converts a Marshmallow object to a JSONSchema dictionary. |
| 742 | |
| 743 | :param m.Schema|m.fields.Field|Validator obj: |
| 744 | The Marshmallow object to be converted |
| 745 | :param _Context context: |
| 746 | Various information to help the converter understand how to |
| 747 | convert the given object. |
| 748 | |
| 749 | This helps with all the recursive nonsense. |
| 750 | :rtype: dict |
| 751 | """ |
| 752 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_convert().(self)._get_converter_for_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_get_converter_for_type().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_convert().(obj)).convertscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#convert().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#convert().(obj)=objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_convert().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#convert().(context)=contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_convert().(context)) |
| 753 | |
| 754 | def convertscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#convert().( |
| 755 | selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#convert().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#convert().(obj): MarshmallowObjectscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowObject., openapi_versionscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#convert().(openapi_version): intscip-python python python-stdlib 3.11 builtins/int# = 2 |
| 756 | ) -> Dictscip-python python python-stdlib 3.11 typing/Dict.[strscip-python python python-stdlib 3.11 builtins/str#, Anyscip-python python python-stdlib 3.11 typing/Any.]: |
| 757 | """ |
| 758 | Converts a Marshmallow object to a JSONSchema dictionary. |
| 759 | |
| 760 | :param m.Schema|m.fields.Field|Validator obj: |
| 761 | The Marshmallow object to be converted |
| 762 | :param int openapi_version: major version of OpenAPI to convert obj for |
| 763 | :rtype: dict |
| 764 | """ |
| 765 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#convert().(self)._convertscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_convert().( |
| 766 | objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_convert().(obj)=objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#convert().(obj), |
| 767 | contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_convert().(context)=_Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.( |
| 768 | convert=selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#convert().(self)._convertscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#_convert()., |
| 769 | memo={}, |
| 770 | schema=objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#convert().(obj), |
| 771 | openapi_version=openapi_versionscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#convert().(openapi_version), |
| 772 | ), |
| 773 | ) |
| 774 | |
| 775 | |
| 776 | class EnumConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#(FieldConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#): |
| 777 | MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#MARSHMALLOW_TYPE. = EnumFieldscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumField. # type: ignore |
| 778 | # Note that `obj` is typed as Any in this converter because mypy has great difficulty |
| 779 | # trying to sort out type hints for EnumField, since it could be either m.fields.Enum |
| 780 | # (marshmallow >= 3.18) or marshmallow_enum.EnumField |
| 781 | |
| 782 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.type_scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/type_.type_.) |
| 783 | def get_typescip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(obj): Anyscip-python python python-stdlib 3.11 typing/Any., contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> Unionscip-python python python-stdlib 3.11 typing/Union.[strscip-python python python-stdlib 3.11 builtins/str#, Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]]: |
| 784 | # Note: we don't (yet?) support mix-and-match between load_by and dump_by. Pick one. |
| 785 | if objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(obj).by_value or ( |
| 786 | LoadDumpOptionsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LoadDumpOptions. is not None |
| 787 | and objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(obj).load_by == objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(obj).dump_by == LoadDumpOptionsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LoadDumpOptions..value |
| 788 | ): |
| 789 | # I'm going out on a limb and assuming your enum uses same type for all vals, else caveat emptor: |
| 790 | value_type = typescip-python python python-stdlib 3.11 builtins/type#(nextscip-python python python-stdlib 3.11 builtins/next().(iterscip-python python python-stdlib 3.11 builtins/iter().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(obj).enum)).value) |
| 791 | if value_type is intscip-python python python-stdlib 3.11 builtins/int#: |
| 792 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(self).null_type_determinationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(context), sw.integerscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/integer.integer.) |
| 793 | elif value_type is floatscip-python python python-stdlib 3.11 builtins/float#: |
| 794 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(self).null_type_determinationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(context), sw.numberscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/number.number.) |
| 795 | else: |
| 796 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(self).null_type_determinationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(context), sw.stringscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/string.string.) |
| 797 | else: |
| 798 | return selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(self).null_type_determinationscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#null_type_determination().(objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(obj), contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_type().(context), sw.stringscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/string.string.) |
| 799 | |
| 800 | @sets_swagger_attrscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/sets_swagger_attr().(sw.enumscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.swagger_words`/enum.enum.) |
| 801 | def get_enumscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_enum().(selfscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_enum().(self), objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_enum().(obj): Anyscip-python python python-stdlib 3.11 typing/Any., contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_enum().(context): _Contextscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_Context.) -> Listscip-python python python-stdlib 3.11 typing/List.[strscip-python python python-stdlib 3.11 builtins/str#]: |
| 802 | if objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_enum().(obj).by_value or ( |
| 803 | LoadDumpOptionsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LoadDumpOptions. is not None |
| 804 | and objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_enum().(obj).load_by == objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_enum().(obj).dump_by == LoadDumpOptionsscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LoadDumpOptions..value |
| 805 | ): |
| 806 | return [entry.value for entry in objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_enum().(obj).enum] |
| 807 | else: |
| 808 | return [entry.name for entry in objscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#get_enum().(obj).enum] |
| 809 | |
| 810 | |
| 811 | ALL_CONVERTERSscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ALL_CONVERTERS. = tuplescip-python python python-stdlib 3.11 builtins/tuple#( |
| 812 | [ |
| 813 | klass() |
| 814 | for _, klass in inspectscip-python python python-stdlib 3.11 inspect/__init__:.getmembersscip-python python python-stdlib 3.11 inspect/getmembers().(sysscip-python python python-stdlib 3.11 sys/__init__:.modulesscip-python python python-stdlib 3.11 sys/modules.modules.[__name__scip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/], inspectscip-python python python-stdlib 3.11 inspect/__init__:.isclassscip-python python python-stdlib 3.11 inspect/isclass().) |
| 815 | if issubclass(klass, MarshmallowConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#) |
| 816 | ] |
| 817 | ) |
| 818 | |
| 819 | |
| 820 | def _common_convertersscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_common_converters().() -> Listscip-python python python-stdlib 3.11 typing/List.[MarshmallowConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#]: |
| 821 | """Instantiates the converters we use in ALL of the registries below""" |
| 822 | converters: Listscip-python python python-stdlib 3.11 typing/List.[MarshmallowConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MarshmallowConverter#] = [ |
| 823 | BooleanConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/BooleanConverter#(), |
| 824 | ContainsOnlyConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ContainsOnlyConverter#(), |
| 825 | DateConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateConverter#(), |
| 826 | DateTimeConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DateTimeConverter#(), |
| 827 | FunctionConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FunctionConverter#(), |
| 828 | IntegerConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/IntegerConverter#(), |
| 829 | LengthConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/LengthConverter#(), |
| 830 | ListConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ListConverter#(), |
| 831 | MethodConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MethodConverter#(), |
| 832 | NumberConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NumberConverter#(), |
| 833 | OneOfConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/OneOfConverter#(), |
| 834 | RangeConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/RangeConverter#(), |
| 835 | SchemaConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/SchemaConverter#(), |
| 836 | StringConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/StringConverter#(), |
| 837 | UUIDConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/UUIDConverter#(), |
| 838 | ConstantConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConstantConverter#(), |
| 839 | ] |
| 840 | if EnumConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#.MARSHMALLOW_TYPEscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/FieldConverter#MARSHMALLOW_TYPE. is not None: # type: ignore |
| 841 | converters.appendscip-python python python-stdlib 3.11 builtins/list#append().(EnumConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/EnumConverter#()) |
| 842 | |
| 843 | return converters |
| 844 | |
| 845 | |
| 846 | query_string_converter_registryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/query_string_converter_registry.query_string_converter_registry.: ConverterRegistryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry# = ConverterRegistryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#() |
| 847 | query_string_converter_registryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/query_string_converter_registry.query_string_converter_registry..register_typesscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#register_types().( |
| 848 | _common_convertersscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_common_converters().() + [CsvArrayConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#(), MultiArrayConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MultiArrayConverter#()] |
| 849 | ) |
| 850 | |
| 851 | headers_converter_registryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/headers_converter_registry.headers_converter_registry.: ConverterRegistryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry# = ConverterRegistryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#() |
| 852 | headers_converter_registryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/headers_converter_registry.headers_converter_registry..register_typesscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#register_types().( |
| 853 | _common_convertersscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_common_converters().() + [CsvArrayConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/CsvArrayConverter#(), MultiArrayConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/MultiArrayConverter#()] |
| 854 | ) |
| 855 | |
| 856 | request_body_converter_registryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/request_body_converter_registry.request_body_converter_registry.: ConverterRegistryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry# = ConverterRegistryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#() |
| 857 | request_body_converter_registryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/request_body_converter_registry.request_body_converter_registry..register_typesscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#register_types().( |
| 858 | _common_convertersscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_common_converters().() + [DictConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#(), NestedConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NestedConverter#()] |
| 859 | ) |
| 860 | |
| 861 | response_converter_registryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/response_converter_registry.response_converter_registry.: ConverterRegistryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry# = ConverterRegistryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#() |
| 862 | response_converter_registryscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/response_converter_registry.response_converter_registry..register_typesscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/ConverterRegistry#register_types().( |
| 863 | _common_convertersscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/_common_converters().() + [DictConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/DictConverter#(), NestedConverterscip-python python flask-rebar 3.4.0 `flask_rebar.swagger_generation.marshmallow_to_swagger`/NestedConverter#()] |
| 864 | ) |