swagger-cli icon indicating copy to clipboard operation
swagger-cli copied to clipboard

Validate does not detect missing field in required

Open mtaylorfsmb opened this issue 5 years ago • 3 comments

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 ]

mtaylorfsmb avatar Oct 07 '20 20:10 mtaylorfsmb

Got bitten by this bug, too.

prometheas avatar Nov 04 '20 17:11 prometheas

Is anyone monitoring this…?

prometheas avatar Nov 11 '20 19:11 prometheas

Stand by - there will be a pull request soon.

stueynz avatar Jul 20 '21 21:07 stueynz