Tags: go-openapi/validate
Tags
fix(parameters): applied extra schema validation to parameters (#166) * fix(parameters): applied extra schema validation to parameters This PR applies an extra jsonschema validation to expanded parameters. Whenever a parameter is provided as a $ref, jsonschema validation works at the level of the unexpanded parameter only. It is indeed valid to declare a parameter as a json reference. The issue is that the expanded content of this parameter definition is subject only to "extra rules" (uniqueness, etc) and not to the basic jsonschema rules (e.g. allowed and required properties). An example is provided by go-swagger/go-swagger#2527. It seems that this situation never occured before go-swagger/go-swagger#2527 because the "parameters" section to which shared parameters normally point to is always fully expanded. In the case of a $ref to a schema in "definition", the invalid content of the $ref incorrectly passes validation. * fixes #165 * contributes go-swagger/go-swagger#2527 Signed-off-by: Frederic BIDON <fredbi@yahoo.com> * added unit test to assert that no duplicate messages are spewed out Signed-off-by: Frederic BIDON <fredbi@yahoo.com> --------- Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
PreviousNext