コード例 #1
0
    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)
コード例 #2
0
ファイル: validators.py プロジェクト: correl/openapi-core
    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)