swagger-parser
swagger-parser copied to clipboard
Undefined but required properties do not fail the validation
Description
The validation does not check whether a required property is actually part of the definition:
A message like Schema properties specified as 'required' must be defined
is not created for the validation
Swagger-codegen version
2.2.2
Swagger declaration file content or url
In below the version is required but not a property:
Sample:
required:
- name
- version
properties:
name:
type: string
Command line used for generation
Steps to reproduce
Related issues
Suggest a Fix
Hi @mischac is this still an issue? I see a closed PR in other project. Did That fixed your issue?
Required properties that do not have a schema defined are a valid use case. In that case the required property must only be present, and any value is accepted.