Schema-First 0.16.2__tar.gz → 0.16.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {schema_first-0.16.2 → schema_first-0.16.3}/PKG-INFO +1 -1
- {schema_first-0.16.2 → schema_first-0.16.3}/pyproject.toml +1 -1
- {schema_first-0.16.2 → schema_first-0.16.3}/src/Schema_First.egg-info/PKG-INFO +1 -1
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/query/validator.py +6 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/tests/test_query_validators.py +18 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/README.md +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/setup.cfg +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/Schema_First.egg-info/SOURCES.txt +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/Schema_First.egg-info/dependency_links.txt +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/Schema_First.egg-info/requires.txt +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/Schema_First.egg-info/top_level.txt +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/__init__.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/exceptions.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/loaders/__init__.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/loaders/exc.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/loaders/yaml_loader.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/__init__.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/exc.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/__init__.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/base.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/constants.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/fields.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/components_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/contact_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/example_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/external_docs_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/header_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/info_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/license_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/media_type_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/openapi_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/operation_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/parameter_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/path_item_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/reference_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/request_body_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/responses_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/schema_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/security_scheme_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/server_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/server_variable_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/tag_object_schema.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/validators.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/query/exceptions.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/specification/__init__.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/specification/spilli_api.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/tests/test_specification.py +0 -0
- {schema_first-0.16.2 → schema_first-0.16.3}/tests/test_validator.py +0 -0
|
@@ -85,6 +85,12 @@ class HTTPQueryValidator:
|
|
|
85
85
|
body_schema = content_type.get('schema')
|
|
86
86
|
if body_schema:
|
|
87
87
|
response_fields['body'] = fields.Nested(body_schema)
|
|
88
|
+
elif 'application/octet-stream' in content:
|
|
89
|
+
response_fields['content_type'] = fields.String()
|
|
90
|
+
response_fields['body'] = fields.Raw()
|
|
91
|
+
else:
|
|
92
|
+
raise NotImplementedError
|
|
93
|
+
|
|
88
94
|
else:
|
|
89
95
|
# If body must be empty.
|
|
90
96
|
if data.get('content_type'):
|
|
@@ -178,6 +178,24 @@ def test_query_validators__response__empty_body_in_spec(fx_openapi_3_2_0, fx_ope
|
|
|
178
178
|
assert serialized_request == request
|
|
179
179
|
|
|
180
180
|
|
|
181
|
+
def test_query_validators__binary_response(fx_openapi_3_2_0, fx_open_spec):
|
|
182
|
+
file_path = fx_openapi_3_2_0('query_validator/binary_response.yaml')
|
|
183
|
+
spec = fx_open_spec(file_path)
|
|
184
|
+
query_validator = HTTPQueryValidator(spec)
|
|
185
|
+
|
|
186
|
+
request = {
|
|
187
|
+
'endpoint': '/endpoint',
|
|
188
|
+
'method': 'get',
|
|
189
|
+
'content_type': 'multipart/form-data',
|
|
190
|
+
'status_code': '200',
|
|
191
|
+
'body': b'content',
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
serialized_request = query_validator.response_handler(**request)
|
|
195
|
+
|
|
196
|
+
assert serialized_request == request
|
|
197
|
+
|
|
198
|
+
|
|
181
199
|
def test_query_validators__response__empty_body_in_spec_error(fx_openapi_3_2_0, fx_open_spec):
|
|
182
200
|
file_path = fx_openapi_3_2_0('query_validator/empty_body.yaml')
|
|
183
201
|
spec = fx_open_spec(file_path)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|