-
An empty string is valid as a string, but if a format is specified, would an empty string be considered an invalid value? paths:.
'/foo/v1/bar':: ``post:''
post:: ``post:''
requestBody:: content
content: application/json:: post
application/json:: schema
schema: object
type: object
properties: properties
something_date: string
type: string
format: date |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Looking at the RFC definition they reference: full-date = date-fullyear "-" date-month "-" date-mday So the definition of a "full-date" would not allow an empty string. So according to the "date" format an empty string would be invalid. However it is explicitly stated that Tools that do not recognize a specific format MAY default back to the type alone, as if the format is not specified.. So I think the answer is: "it depends on the tool you use" as it is the tool that decides whether |
Beta Was this translation helpful? Give feedback.
-
Closing this as resolved as the answer was accepted. |
Beta Was this translation helpful? Give feedback.
Looking at the RFC definition they reference: full-date = date-fullyear "-" date-month "-" date-mday
So the definition of a "full-date" would not allow an empty string. So according to the "date" format an empty string would be invalid.
However it is explicitly stated that Tools that do not recognize a specific format MAY default back to the type alone, as if the format is not specified..
So I think the answer is: "it depends on the tool you use" as it is the tool that decides whether
format: date
means anything.