Skip to content

Missing required property definition while using allOf with requried and properties #1212

@jeremycohensolal

Description

@jeremycohensolal

Swagger File

---
  swagger: "2.0"
  info: 
    version: "1.0.0"
    title: "test API"
    description: "Handle all internals requests to back-office."

  host: "test.api.com"
  basePath: "/v2"
  schemes: 
    - "https"
  consumes: 
    - "application/json"
  produces: 
    - "application/json"

  paths:
    /foo:
      post: 
        summary: "Create a foo"
        parameters:
          - 
            name: "bar"
            in: "body"
            required: true
            schema: 
              allOf: 
                - 
                  required: 
                    - "req1"
                    - "req2"
                    - "req3"
                    - "req4"
                - 
                  properties: 
                    req1:
                      type: "string"
                      format: "uuid"
                - 
                  $ref: "#/definitions/Foo"

        responses: 
          201: 
            description: "The created foo"

  definitions:
    Foo:
      type: "object"
      properties: 
        req2:
          type: "string"

        req3:
          type: "string"

        req4:
          type: "string"

        opt1:
          type: "string"

        opt2:
          type: "string"
  • Version: 51.0.1 (32 bits)
  • Browser/OS: Firefox

Issue

Using this YAML file throw these errors

swag

Other validating tools are ok...

term

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions