error object properties "schema" and "relative_schema_path" seem to be inconsistent
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu với gist được liên kết và tái hiện đầu ra ValidationError đã được báo cáo, sau đó đọc các trường ValidationError liên quan: schema, relative_schema_path, schema_path, path và validator. Xác định mối quan hệ dự kiến giữa đoạn schema được báo cáo và các đường dẫn schema; hoàn thành khi các trường nhất quán và bản tái hiện được bao phủ bởi một bài kiểm thử hồi quy.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I need to parse a jsonschema.exceptions.ValidationError object to help produce a more useful error message to my customers, but I am not sure that the fields of the ValidationError object are correct.
Test case: https://gist.github.com/jason-s/6d2b3418f4edb7fc8064
Raw object (in yaml format, but jsonschema is representation-agnostic -- thank you, it means I can use it for yaml files):
debug:
foo:
bar:
jiminy: cricket
mickey: mouse
44hoho: twinkie
The validator correctly find that 44hoho is not a legal property name; it doesn't match patternProperties and in my schema I have additionalProperties = false.
The problem is that the error object's relative_schema_path and schema seem inconsistent.
My test case prints:
parent : None
relative_path : deque(['debug', 'foo', 'bar'])
relative_schema_path: deque(['properties', 'debug', 'properties', 'foo', 'properties', 'bar', 'additionalProperties'])
instance : {'jiminy': 'cricket', 'mickey': 'mouse', '44hoho': 'twinkie'}
schema_path : deque(['properties', 'debug', 'properties', 'foo', 'properties', 'bar', 'additionalProperties'])
validator : additionalProperties
context : []
path : deque(['debug', 'foo', 'bar'])
message : Additional properties are not allowed ('44hoho' was unexpected)
schema : {'additionalProperties': False, 'type': 'object', 'patternProperties': {'^[^\\d\\W]\\w*$': {'type': 'string'}}}
cause : None
validator_value: False
Note that the schema attribute is a sub-portion of the schema object, but the relative schema path is from the root schema.
- Ngôn ngữ chính
- Python
- Star
- 5k
- Fork
- 694
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc 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-jsonschema/jsonschema
-
Iterator error contexts lose parent links and absolute pathsCó thể đã có người làm @DawnofGenX đã nhận 4 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
python-jsonschema/jsonschema#1584 · 3 bình luận ·
-
regex format checker crashes with RecursionError on deeply nested patternsCó thể đã có người làm @DawnofGenX đã nhận 4 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
python-jsonschema/jsonschema#1538 · 1 bình luận ·
-
is_duration raises an uncaught decimal.Overflow on a duration with a large exponentCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởNeeds Test Upstream
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
python-jsonschema/jsonschema#1511 · 1 bình luận ·
-
regex format checker crashes with ValueError on conflicting inline flagsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
python-jsonschema/jsonschema#1558 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
python-jsonschema/jsonschema#1547 ·
Tất cả issue của python-jsonschema/jsonschema
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
EvaluationSuite.run fails with default args_for_task and mutates supplied kwargsCó thể đã có người làm @ktz03 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
huggingface/evaluate#825 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add `django-upgrade` to the CIĐang mởdependencies feature github_actions good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
wemake-services/wemake-django-template#3149 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[request] vsg/1.1.16Đang mởupstream update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
conan-io/conan-center-index#31142 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:core bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày