APIDevTools / swagger-cli

Swagger 2.0 and OpenAPI 3.0 command-line tool
https://apitools.dev/swagger-cli
MIT License
515 stars 69 forks source link

Validate null value in enums #42

Closed mwxxhdb closed 4 years ago

mwxxhdb commented 4 years ago

Incorrect YAML

EnumObject:
  type: string
  enum:
    - NULL
    - ITEM1
    - ITEM2

Correct YAML

EnumObject:
  type: string
  enum:
    - 'NULL'
    - ITEM1
    - ITEM2

Issue: There are warnings if using the incorrect YAML in SwaggerHub, but swagger-cli said the document is valid.

Warnings from SwaggerHub: enum value should conform to its schema's type

Expect result: Same warning as SwaggerHub.

mwxxhdb commented 4 years ago

This issue moved to swagger-parser project #144