Skip to content

Confusing error message "should NOT be valid" caused by empty responses #1808

@hkosova

Description

@hkosova

Q&A (please complete the following information)

  • OS: Windows
  • Browser: Chrome 67
  • Method of installation: http://editor.swagger.io
  • Swagger-Editor version: 3.6.0
  • Swagger/OpenAPI version: 2.0, 3.0

Example Swagger/OpenAPI definition

2.0:

swagger: "2.0"
info:
  version: 0.0.0
  title: test
paths:
  /foo:
    get:
      responses: {}

3.0:

openapi: 3.0.1
info:
  version: 0.0.0
  title: test
paths:
  /foo:
    get:
      responses: {}

Describe the bug you're encountering

The response: {} line causes two validation errors:

  1. should NOT have less than 1 properties
  2. should NOT be valid

The second error does not make sense.

Expected behavior

No "should NOT be valid" error.

Screenshots

error

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions