Format validation of integer types #922
-
Hello, In the specification I can read the following:
Does that mean that the format validation, for those predefined formats, is only executed when the data is a string? (Like properties are only used if the data is an object). Or should the format fail if the data is not a string? I'm trying to implement a validator for OAS 3.1 and their formats include integer formats like Should my validator fail if the input data is not an integer (say an array), or should it check that the format does not applies to arrays and ignore it? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes. This is correct. I believe that's the intended purpose for that OAS format as well.
Formats ignore (implicitly pass) instance types they don't check. So if you have |
Beta Was this translation helpful? Give feedback.
Yes. This is correct. I believe that's the intended purpose for that OAS format as well.
Formats ignore (implicitly pass) instance types they don't check. So if you have
int64
and don't get an integer, the validation is skipped.