Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validator doesn't report properties that are in the required list but not defined #266

Open
energister opened this issue Aug 18, 2023 · 0 comments

Comments

@energister
Copy link

energister commented Aug 18, 2023

Following specification causes validator to report only the event-photo property

Required list has not defined properties: ['event-photo']

whereas I would expect similar messages for the problem-type, order-trees and site-location properties.

openapi: 3.0.3
info:
  title: Protect Earth API
  version: 0.3.0
paths:
  /events:
    get:
      operationId: get-events
      summary: Get Events
      description: Get a list of all the events
      tags:
        - Event
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Generic_Problem'

  /orders:
    post:
      operationId: post-orders
      summary: Create Order
      tags:
        - Order
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Order'
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Event'

components:
  schemas:
    Generic_Problem:
      title: Problem
      type: object
      required:
        - problem-type
        - title
      properties:
        title:
          type: string
        status:
          type: integer
  
    Event:
      title: Event
      type: object
      required:
        - description
        - event-photo
      properties:
        id:
          type: string
        summary:
          type: string
        description:
          type: string

    Order:
      title: Order
      type: object
      required:
        - site
        - order-trees
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        site:
          $ref: '#/components/schemas/Site'

    Site:
      title: Site
      type: object
      required:
        - url
        - site-location
      properties:
        id:
          type: string
          format: uuid
        url:
          type: string
          format: url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant