Given a json schema built by swagger I'd like to validate a json requests and responses of my endpoints. If my json data has not all non-required fields, that are described in the schema, then no errors are returned. How can I modify/extend behavior to determine the absence of that fields?
I disassembled the schema and validator code and didn't found an easy way to override the behavior of the schema and of the validator.
var wholeSchema = JsonSchema.FromFileAsync("mypath\\myJson.json").GetAwaiter().GetResult();
var specificRequestSchema = wholeSchema.Definitions["specificRequest"];
var errors = specificRequestSchema.Validate(jsonData);