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.
Files changed (48) hide show
  1. {schema_first-0.16.2 → schema_first-0.16.3}/PKG-INFO +1 -1
  2. {schema_first-0.16.2 → schema_first-0.16.3}/pyproject.toml +1 -1
  3. {schema_first-0.16.2 → schema_first-0.16.3}/src/Schema_First.egg-info/PKG-INFO +1 -1
  4. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/query/validator.py +6 -0
  5. {schema_first-0.16.2 → schema_first-0.16.3}/tests/test_query_validators.py +18 -0
  6. {schema_first-0.16.2 → schema_first-0.16.3}/README.md +0 -0
  7. {schema_first-0.16.2 → schema_first-0.16.3}/setup.cfg +0 -0
  8. {schema_first-0.16.2 → schema_first-0.16.3}/src/Schema_First.egg-info/SOURCES.txt +0 -0
  9. {schema_first-0.16.2 → schema_first-0.16.3}/src/Schema_First.egg-info/dependency_links.txt +0 -0
  10. {schema_first-0.16.2 → schema_first-0.16.3}/src/Schema_First.egg-info/requires.txt +0 -0
  11. {schema_first-0.16.2 → schema_first-0.16.3}/src/Schema_First.egg-info/top_level.txt +0 -0
  12. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/__init__.py +0 -0
  13. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/exceptions.py +0 -0
  14. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/loaders/__init__.py +0 -0
  15. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/loaders/exc.py +0 -0
  16. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/loaders/yaml_loader.py +0 -0
  17. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/__init__.py +0 -0
  18. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/exc.py +0 -0
  19. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/__init__.py +0 -0
  20. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/base.py +0 -0
  21. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/constants.py +0 -0
  22. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/fields.py +0 -0
  23. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/components_object_schema.py +0 -0
  24. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/contact_object_schema.py +0 -0
  25. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/example_object_schema.py +0 -0
  26. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/external_docs_object_schema.py +0 -0
  27. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/header_object_schema.py +0 -0
  28. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/info_object_schema.py +0 -0
  29. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/license_object_schema.py +0 -0
  30. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/media_type_object_schema.py +0 -0
  31. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/openapi_object_schema.py +0 -0
  32. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/operation_object_schema.py +0 -0
  33. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/parameter_object_schema.py +0 -0
  34. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/path_item_object_schema.py +0 -0
  35. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/reference_object_schema.py +0 -0
  36. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/request_body_object_schema.py +0 -0
  37. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/responses_object_schema.py +0 -0
  38. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/schema_object_schema.py +0 -0
  39. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/security_scheme_object_schema.py +0 -0
  40. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/server_object_schema.py +0 -0
  41. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/server_variable_object_schema.py +0 -0
  42. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/v3_2/tag_object_schema.py +0 -0
  43. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/openapi/schemas/validators.py +0 -0
  44. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/query/exceptions.py +0 -0
  45. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/specification/__init__.py +0 -0
  46. {schema_first-0.16.2 → schema_first-0.16.3}/src/schema_first/specification/spilli_api.py +0 -0
  47. {schema_first-0.16.2 → schema_first-0.16.3}/tests/test_specification.py +0 -0
  48. {schema_first-0.16.2 → schema_first-0.16.3}/tests/test_validator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Schema-First
3
- Version: 0.16.2
3
+ Version: 0.16.3
4
4
  Summary: OpenAPI specification validator and converter to Marshmallow schemas.
5
5
  Author-email: Konstantin Fadeev <jredkiy@yandex.ru>
6
6
  License-Expression: LGPL-2.1-only
@@ -20,7 +20,7 @@ license-files = ["LICENSE.txt"]
20
20
  name = "Schema-First"
21
21
  readme = "README.md"
22
22
  requires-python = ">=3.12"
23
- version = "0.16.2"
23
+ version = "0.16.3"
24
24
 
25
25
  [project.optional-dependencies]
26
26
  dev = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Schema-First
3
- Version: 0.16.2
3
+ Version: 0.16.3
4
4
  Summary: OpenAPI specification validator and converter to Marshmallow schemas.
5
5
  Author-email: Konstantin Fadeev <jredkiy@yandex.ru>
6
6
  License-Expression: LGPL-2.1-only
@@ -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