IBM Validator `examples` Keyword as Disallowed in OpenAPI Schema

Đang mở
#747 2 bình luận 1 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
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, openapi
Lĩnh vực
api, tooling

Hướng nghiên cứu

Bắt đầu bằng cách chạy IBM OpenAPI Validator đối với tài liệu OpenAPI 3.1.0 trong issue và kiểm tra quy tắc ibm-schema-keywords báo cáo lỗi. Xác nhận cách quy tắc xử lý từ khóa examples ở cấp schema; hoàn thành có nghĩa là tài liệu hợp lệ này không còn báo cáo examples là không được phép mà không làm hỏng việc xác thực từ khóa hiện có.

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

Mô tả

Summary

The IBM OpenAPI Validator reports an error for the examples keyword in the OffsetDateTime schema, stating it is a disallowed keyword. However, the examples keyword is valid in OpenAPI 3.1.0, and its usage in the provided schema appears correct.

Details

When validating the following OpenAPI 3.1.0 schema with the IBM OpenAPI Validator, an error is reported:

Validator Error:

Message: Found disallowed keyword: examples
Rule: ibm-schema-keywords
Path: components.schemas.OffsetDateTime.examples
Line: 33

Full OpenAPI Document:

openapi: 3.1.0
components:
  schemas:
    TestEntity:
      type: object
      required:
      - alias
      - number
      properties:
        createdAt:
          anyOf:
          - $ref: "#/components/schemas/OffsetDateTime"
          - type: "null"
        updatedAt:
          anyOf:
          - $ref: "#/components/schemas/OffsetDateTime"
          - type: "null"
        alias:
          type: string
        number:
          type: string
        id:
          type:
          - integer
          - "null"
          format: int64
          maximum: 9223372036854775807
          minimum: 1
    OffsetDateTime:
      type: string
      format: date-time
      examples:
      - 2022-03-10T12:15:50-04:00
paths:
  /api/v1/tax/test:
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TestEntity"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TestEntity"
      tags:
      - Test Controller
info:
  title: API
  version: unspecified
Ngôn ngữ chính
JavaScript
Star
635
Fork
98
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

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 IBM/openapi-validator

Tất cả issue của IBM/openapi-validator

Issue tương tự

Thêm issue về JavaScript

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.