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 does not detect missing field in required #54

Open mtaylorfsmb opened 3 years ago

mtaylorfsmb commented 3 years ago

Running with the validate command does not detect the case where the required field for a schema refers to a field that does not exist.

I had a model that looked like this.

components:
   schemas:
      Audit:
         properties:
             createDate:
                 type: string
         required: [ createDate ]

The schema was valid. I then changed the name of a property but forgot to rename the field in the required list and it validated successfully anyway.

components:
   schemas:
      Audit:
         properties:
             createDateTime:
                 type: string
         required: [ createDate ]
prometheas commented 3 years ago

Got bitten by this bug, too.

prometheas commented 3 years ago

Is anyone monitoring this…?

stueynz commented 3 years ago

Stand by - there will be a pull request soon.