Possible Regression: RecursionError validating oneOf/allOf schema in 0.7.2 (works in 0.7.1)
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
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- openapi, python
- Lĩnh vực
- api, testing-qa
Hướng nghiên cứu
Start by running the supplied validate.py reproduction with openapi-spec-validator 0.7.2, then compare it with 0.7.1 as shown. Trace the RecursionError from the validate(parsed_spec) entry point through the oneOf/allOf and $ref schema validation, and consider the issue done when the reproduction validates successfully without recursion failure while preserving the 0.7.1 result.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
An OpenAPI 3.1 schema that validated fine with openapi-spec-validator 0.7.1 now fails with a RecursionError in 0.7.2
Environment
openapi-spec-validator | 0.7.2 ❌ / 0.7.1 ✅
uv 0.7.3 (3c413f74b 2025-05-07)
Minimal reproduction
# validate.py
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "openapi-spec-validator==0.7.2" # TODO: test with 0.7.1
# ]
# ///
import yaml
from openapi_spec_validator import validate
openapi_spec = """
openapi: 3.1.0
info:
title: Recursion Bug Demo
version: 0.1.0
components:
schemas:
PropertyConstraint:
type: object
oneOf:
- $ref: '#/components/schemas/PropertyEqualityConstraint'
- $ref: '#/components/schemas/PropertyRangeConstraint'
properties:
property_id:
type: string
type:
type: string
required: [type]
PropertyEqualityConstraint:
allOf:
- $ref: '#/components/schemas/PropertyConstraint'
- type: object
properties:
property_id:
type: string
property_value: {}
required: [property_id, property_value]
PropertyRangeConstraint:
allOf:
- $ref: '#/components/schemas/PropertyConstraint'
- type: object
properties:
property_id:
type: string
min: {}
max: {}
required: [property_id, min, max]
"""
parsed_spec = yaml.safe_load(openapi_spec)
validate(parsed_spec)
print("valid")
> uv run validate.py
RecursionError: maximum recursion depth exceeded
Set the version to 0.7.1 in the uv script tag at the top.
> uv run validate.py
valid
Has anyone else observed this behaviour?
- Ngôn ngữ chính
- Python
- Star
- 409
- Fork
- 73
- 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-spec-validator
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 30/100
-
kind/bug/confirmed
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
python-openapi/openapi-spec-validator#373 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Tất cả issue của python-openapi/openapi-spec-validator
Issue tương tự
-
documentation help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
simonw/sqlite-utils#872 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100