wheer.blogg.se

Swagger editor what is a date
Swagger editor what is a date






I also recommend putting the format in the description field so human consumers can read it more easily.Swagger is an open-source framework for designing and describing APIs.

swagger editor what is a date

This allows a client tool to automatically parse the date or date-time. Instead, pattern can be used to give a regular expression that defines the date or date-time pattern. The property must be defined as having a type equal to string without using format.

swagger editor what is a date

If a web service exposes a date or a date-time that doesn't conform to the Internet Date/Time Format described in RFC3339, then date and date-time are not valid values for the format field. OpenAPI 3.0: This object is an extended subset of the JSON Schema Specification Wright Draft 00. OpenAPI 2.0: This object is based on the JSON Schema Specification Draft 4 and uses This is because OpenAPI objects are based off the JSON Schema specification. Pattern (This string SHOULD be a valid regular expression, according to the ECMA 262 regular expression dialect) This is stated in the OpenAPI Specification. If you are violating any of the above rules to work around bugs in tools that generate UIs from OpenAPI specifications, you should strongly consider raising these bugs with that tool, rather than generating an invalid OpenAPI spec to work around this.

swagger editor what is a date

Instead, you should specify format: string with an appropriate pattern.įinally, note that a pattern of "YYYY-MM-DD" is invalid according to the specification: pattern must be a regular expression, not a placeholder or format string. If you need to support dates/times formatted in a way that differs to RFC 3339, you are not allowed to specify your parameter as format: date or format: date-time. As such, when using date or date-time, the pattern is unnecessary and in fact, should be omitted. So for date values should look like "" and for date-time, "". The patterns supported are defined in RFC 3339, section 5.6 (effectively ISO 8601) and examples are provided in section 5.8. The OpenAPI Specification says that you must use:








Swagger editor what is a date