Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Response schema validation message is not clear for arrays

Đang mở
#128 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
38/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

Hướng nghiên cứu

No source files or tests are named in the issue. Reproduce the response-schema validation with the shown YAML array schema and inspect the validation path that produces “Value id is not of type SchemaType.OBJECT.” Done means the error clearly identifies that the response value should be an array.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area/schema kind/bug/confirmed

Use case description.
Inside my schema yaml file I've specified that response from some URL handler would be an array of objects, e.g.:

      responses:
        "200":
          description: An array of provisioned Resource Records
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ResourceRecord'

I've also described what is ResourceRecord inside the same yaml file

For some reason the code returns an object, not an array
in this case the exception message from OpenAPI framework is a bit strange:

SchemaValidationError: Mimetype invalid: Value id is not of type SchemaType.OBJECT

id from error is the 1st attribute of my object (specified in yaml spec)

What is expected.
The expected error message is to complain that no array specified, array is missed, etc

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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của python-openapi/openapi-core

Tất cả issue của python-openapi/openapi-core

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.