No support for specifying any type
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- openapi, python
- Lĩnh vực
- api, backend-api-design
Hướng nghiên cứu
Start with openapi_core/unmarshalling/schemas/unmarshallers.py and factories.py, following the traceback through oneOf handling and array items creation. Reproduce the provided schema with an array whose items are {} and verify that validation succeeds without the "schema not type of Schema" error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Swagger spec:
Query:
type: object
required:
- select
properties:
select:
type: array
items:
type: string
where:
type: array
items:
type: object
required:
- name
- operator
- value
properties:
name:
type: string
operator:
type: string
value:
oneOf:
- type: string
- type: number
- type: boolean
- type: array
items: {}
It failed to validate array type for value property (other types are validated fine, when array is removed).
Using lib in combination with Falcon, error is:
Traceback (most recent call last):
File "D:\.venv\lib\site-packages\falcon\api.py", line 242, in __call__
process_resource(req, resp, resource, params)
File "D:\.venv\lib\site-packages\my_lib\falcon_svc.py", line 391, in process_resource
result = validator.validate(openapi_request)
File "D:\.venv\lib\site-packages\openapi_core\validation\request\validators.py", line 48, in validate
body, body_errors = self._get_body(request, operation)
File "D:\.venv\lib\site-packages\openapi_core\validation\request\validators.py", line 174, in _get_body
body = self._unmarshal(media_type, casted)
File "D:\.venv\lib\site-packages\openapi_core\validation\request\validators.py", line 221, in _unmarshal
param_or_media_type, value, context=UnmarshalContext.REQUEST,
File "D:\.venv\lib\site-packages\openapi_core\validation\validators.py", line 53, in _unmarshal
return unmarshaller(value)
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\unmarshallers.py", line 181, in __call__
properties = self._unmarshal_properties(value)
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\unmarshallers.py", line 225, in _unmarshal_properties
prop)(prop_value)
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\unmarshallers.py", line 146, in __call__
return list(map(self.items_unmarshaller, value))
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\unmarshallers.py", line 181, in __call__
properties = self._unmarshal_properties(value)
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\unmarshallers.py", line 225, in _unmarshal_properties
prop)(prop_value)
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\unmarshallers.py", line 244, in __call__
return self.unmarshallers_factory.create(one_of_schema)(value)
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\unmarshallers.py", line 146, in __call__
return list(map(self.items_unmarshaller, value))
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\unmarshallers.py", line 141, in items_unmarshaller
return self.unmarshallers_factory.create(self.schema.items)
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\factories.py", line 48, in create
raise TypeError("schema not type of Schema")
TypeError: schema not type of Schema
Maybe I'm doing something wrong (?!), but not found in OpenAPI documentation any limitation for array in usage with oneOf, so I assume that above spec is valid and issue is definitely in the lib validation.
- Ngôn ngữ chính
- Python
- Star
- 368
- Fork
- 140
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của python-openapi/openapi-core
-
kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
python-openapi/openapi-core#1188 · 2 bình luận ·
-
kind/bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
python-openapi/openapi-core#1225 · 2 bình luận ·
-
kind/bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
python-openapi/openapi-core#1212 ·
-
[Bug]: Query parameter validation fails to match empty string when listed as a valid enum value Đang mởkind/bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
python-openapi/openapi-core#1210 ·
-
kind/bug kind/bug/confirmed
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
python-openapi/openapi-core#1180 · 3 bình luận ·
Tất cả issue của python-openapi/openapi-core
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
canonical/paas-charm#368 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
tech debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
addition to tracking list Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
StevenBlack/hosts#3256 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
qualcomm/qai-appbuilder#275 ·