Schema-First 0.16.1__tar.gz → 0.16.2__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.1 → schema_first-0.16.2}/PKG-INFO +3 -3
- {schema_first-0.16.1 → schema_first-0.16.2}/pyproject.toml +3 -3
- {schema_first-0.16.1 → schema_first-0.16.2}/src/Schema_First.egg-info/PKG-INFO +3 -3
- {schema_first-0.16.1 → schema_first-0.16.2}/src/Schema_First.egg-info/requires.txt +2 -2
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/query/validator.py +5 -1
- {schema_first-0.16.1 → schema_first-0.16.2}/tests/test_query_validators.py +6 -1
- {schema_first-0.16.1 → schema_first-0.16.2}/README.md +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/setup.cfg +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/Schema_First.egg-info/SOURCES.txt +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/Schema_First.egg-info/dependency_links.txt +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/Schema_First.egg-info/top_level.txt +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/__init__.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/exceptions.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/loaders/__init__.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/loaders/exc.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/loaders/yaml_loader.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/__init__.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/exc.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/__init__.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/base.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/constants.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/fields.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/components_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/contact_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/example_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/external_docs_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/header_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/info_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/license_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/media_type_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/openapi_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/operation_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/parameter_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/path_item_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/reference_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/request_body_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/responses_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/schema_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/security_scheme_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/server_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/server_variable_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/v3_2/tag_object_schema.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/openapi/schemas/validators.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/query/exceptions.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/specification/__init__.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/src/schema_first/specification/spilli_api.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/tests/test_specification.py +0 -0
- {schema_first-0.16.1 → schema_first-0.16.2}/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.
|
|
3
|
+
Version: 0.16.2
|
|
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
|
|
@@ -16,11 +16,11 @@ Provides-Extra: dev
|
|
|
16
16
|
Requires-Dist: bandit>=1.9.3; extra == "dev"
|
|
17
17
|
Requires-Dist: build>=1.4.0; extra == "dev"
|
|
18
18
|
Requires-Dist: openapi-spec-validator>=0.7.1; extra == "dev"
|
|
19
|
-
Requires-Dist: pre-commit>=4.
|
|
19
|
+
Requires-Dist: pre-commit>=4.6.2; extra == "dev"
|
|
20
20
|
Requires-Dist: pytest>=9.1.1; extra == "dev"
|
|
21
21
|
Requires-Dist: pytest-cov>=7.0.0; extra == "dev"
|
|
22
22
|
Requires-Dist: python-dotenv>=1.2.1; extra == "dev"
|
|
23
|
-
Requires-Dist: tox==4.
|
|
23
|
+
Requires-Dist: tox==4.59.0; extra == "dev"
|
|
24
24
|
Requires-Dist: twine==6.2.0; extra == "dev"
|
|
25
25
|
|
|
26
26
|
# Schema-First
|
|
@@ -20,18 +20,18 @@ license-files = ["LICENSE.txt"]
|
|
|
20
20
|
name = "Schema-First"
|
|
21
21
|
readme = "README.md"
|
|
22
22
|
requires-python = ">=3.12"
|
|
23
|
-
version = "0.16.
|
|
23
|
+
version = "0.16.2"
|
|
24
24
|
|
|
25
25
|
[project.optional-dependencies]
|
|
26
26
|
dev = [
|
|
27
27
|
"bandit>=1.9.3",
|
|
28
28
|
"build>=1.4.0",
|
|
29
29
|
'openapi-spec-validator>=0.7.1',
|
|
30
|
-
"pre-commit>=4.
|
|
30
|
+
"pre-commit>=4.6.2",
|
|
31
31
|
"pytest>=9.1.1",
|
|
32
32
|
"pytest-cov>=7.0.0",
|
|
33
33
|
"python-dotenv>=1.2.1",
|
|
34
|
-
"tox==4.
|
|
34
|
+
"tox==4.59.0",
|
|
35
35
|
"twine==6.2.0"
|
|
36
36
|
]
|
|
37
37
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Schema-First
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.2
|
|
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
|
|
@@ -16,11 +16,11 @@ Provides-Extra: dev
|
|
|
16
16
|
Requires-Dist: bandit>=1.9.3; extra == "dev"
|
|
17
17
|
Requires-Dist: build>=1.4.0; extra == "dev"
|
|
18
18
|
Requires-Dist: openapi-spec-validator>=0.7.1; extra == "dev"
|
|
19
|
-
Requires-Dist: pre-commit>=4.
|
|
19
|
+
Requires-Dist: pre-commit>=4.6.2; extra == "dev"
|
|
20
20
|
Requires-Dist: pytest>=9.1.1; extra == "dev"
|
|
21
21
|
Requires-Dist: pytest-cov>=7.0.0; extra == "dev"
|
|
22
22
|
Requires-Dist: python-dotenv>=1.2.1; extra == "dev"
|
|
23
|
-
Requires-Dist: tox==4.
|
|
23
|
+
Requires-Dist: tox==4.59.0; extra == "dev"
|
|
24
24
|
Requires-Dist: twine==6.2.0; extra == "dev"
|
|
25
25
|
|
|
26
26
|
# Schema-First
|
|
@@ -85,6 +85,10 @@ 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
|
+
else:
|
|
89
|
+
# If body must be empty.
|
|
90
|
+
if data.get('content_type'):
|
|
91
|
+
response_fields['content_type'] = fields.String()
|
|
88
92
|
|
|
89
93
|
response_schema = Schema.from_dict(response_fields)
|
|
90
94
|
response_schema.Meta.unknown = 'raise'
|
|
@@ -128,7 +132,7 @@ class HTTPQueryValidator:
|
|
|
128
132
|
endpoint: str,
|
|
129
133
|
method: t.Literal['post', 'get', 'update', 'patch', 'delete'],
|
|
130
134
|
status_code: str,
|
|
131
|
-
content_type:
|
|
135
|
+
content_type: str or ... = ...,
|
|
132
136
|
body: dict[str, t.Any] or ... = ...,
|
|
133
137
|
):
|
|
134
138
|
all_kwargs = {
|
|
@@ -166,7 +166,12 @@ def test_query_validators__response__empty_body_in_spec(fx_openapi_3_2_0, fx_ope
|
|
|
166
166
|
spec = fx_open_spec(file_path)
|
|
167
167
|
query_validator = HTTPQueryValidator(spec)
|
|
168
168
|
|
|
169
|
-
request = {
|
|
169
|
+
request = {
|
|
170
|
+
'endpoint': '/endpoint',
|
|
171
|
+
'method': 'get',
|
|
172
|
+
'content_type': 'application/json',
|
|
173
|
+
'status_code': '204',
|
|
174
|
+
}
|
|
170
175
|
|
|
171
176
|
serialized_request = query_validator.response_handler(**request)
|
|
172
177
|
|
|
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
|