kstasik / schema-tools

Set of tools for codegen, preprocessing and validation of json-schema and openapi spec
MIT License
41 stars 13 forks source link

{type: number, format: int32} should be a validation error #66

Open jayvdb opened 1 year ago

jayvdb commented 1 year ago

{type: number, format: int32} is not ideal OAS 3.0.3, as it defines a format which should be an integer, but uses type: number when the type: integer should be used.

As it is ambiguous, the validator should emit an error of some sort, as openapi tools are very likely to either ignore either type or format, or fail when trying to combined the two.

An example of a tool which silently ignores the format is https://github.com/oxidecomputer/progenitor/issues/266