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

Abierto
#266 0 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
python
Área
api

Línea de trabajo

Reproduce the supplied OpenAPI 3.0.3 example and inspect how required properties are checked when they are absent from properties. Done means the validator reports every undefined required property, including problem-type, order-trees, and site-location, rather than only event-photo.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Python
Estrellas
409
Forks
73
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de python-openapi/openapi-spec-validator

Todos los issues de python-openapi/openapi-spec-validator

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.