You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some cases it may be useful to be able to register custom schema transformations or otherwise transform schema object prior to validation. Possible use cases:
correct spelling of some properties in Swagger schema (e.g. "x-oneof" to "x-oneOf")
add "type" property to schema definitions that don't have it but otherwise do describe proper objects ("type" is not a required property according to JSON Schema specification but without it most glaring discrepancies, such as giving string value to an object property, go undetected by validator)
Granted, these use cases would be most properly addressed by correcting the Swagger schema itself but in some cases it is beyond our control.
One option to achieve this would be by opening public access to SwaggerValidator(JsonNode) constructor or otherwise allow to pass already processed JsonNode to the builder.
The text was updated successfully, but these errors were encountered:
Yes, this would allow to cover the use cases I mentioned although it would be nice not to have to re-implement transformations logic since it is already there (use case # 1 above).
Wouldn't it also make sense to expose schema factory to be able to register custom keywords if necessary?
In some cases it may be useful to be able to register custom schema transformations or otherwise transform schema object prior to validation. Possible use cases:
Granted, these use cases would be most properly addressed by correcting the Swagger schema itself but in some cases it is beyond our control.
One option to achieve this would be by opening public access to
SwaggerValidator(JsonNode)
constructor or otherwise allow to pass already processed JsonNode to the builder.The text was updated successfully, but these errors were encountered: