def _unmarshal(self, param_or_media_type, value, context): if not param_or_media_type.schema: return value from openapi_core.unmarshalling.schemas.factories import ( SchemaUnmarshallersFactory, ) unmarshallers_factory = SchemaUnmarshallersFactory( self.spec._resolver, self.custom_formatters, context=context, ) unmarshaller = unmarshallers_factory.create(param_or_media_type.schema) return unmarshaller(value)
def create_unmarshaller(schema, custom_formatters=None, context=None): custom_formatters = custom_formatters or {} format_checker = build_format_checker(**custom_formatters) return SchemaUnmarshallersFactory( format_checker=format_checker, custom_formatters=custom_formatters, context=context).create( schema)
def schema_unmarshallers_factory(self): spec_resolver = self.spec.accessor.dereferencer.resolver_manager.\ resolver return SchemaUnmarshallersFactory( spec_resolver, self.format_checker, self.custom_formatters, context=UnmarshalContext.RESPONSE, )
def _unmarshal(self, param_or_media_type, value, context): if 'schema' not in param_or_media_type: return value from openapi_core.unmarshalling.schemas.factories import ( SchemaUnmarshallersFactory, ) spec_resolver = self.spec.accessor.dereferencer.resolver_manager.\ resolver unmarshallers_factory = SchemaUnmarshallersFactory( spec_resolver, self.format_checker, self.custom_formatters, context=context, ) schema = param_or_media_type / 'schema' unmarshaller = unmarshallers_factory.create(schema) return unmarshaller(value)
def create_validator(schema): format_checker = build_format_checker() return SchemaUnmarshallersFactory( format_checker=format_checker).create(schema)
def create_unmarshaller(schema, custom_formatters=None, context=None): return SchemaUnmarshallersFactory( custom_formatters=custom_formatters, context=context).create( schema)
def create_validator(schema): return SchemaUnmarshallersFactory().create(schema)