Java visualizer integer12/10/2023 ![]() ![]() ![]() Tools that do not support a specific format may default back to the type alone, as if the format is not specified. Tools can use the format to validate the input or to map the value to a specific type in the chosen programming language. However, format is an open value, so you can use any formats, even not those defined by the OpenAPI Specification, such as: ![]() binary – binary data, used to describe files (see Files below).byte – base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw=.password – a hint to UIs to mask the input.date-time – the date-time notation as defined by RFC 3339, section 5.6, for example,.date – full-date notation as defined by RFC 3339, section 5.6, for example,.OpenAPI defines the following built-in string formats: Note that an empty string "" is a valid string unless minLength or pattern is specified.Īn optional format modifier serves as a hint at the contents and format of the string. String length can be restricted using minLength and maxLength: The value of multipleOf must be a positive number, that is, you cannot use multipleOf: -5. multipleOf may be used with floating-point numbers, but in practice this can be unreliable due to the limited precision or floating point math. Use the multipleOf keyword to specify that a number must be the multiple of another number: The word “exclusive” in exclusiveMinimum and exclusiveMaximum means the corresponding boundary is excluded: For example, you can define a floating-point number range as 0–50 and exclude the 0 value: To exclude the boundary values, specify exclusiveMinimum: true and exclusiveMaximum: true. Use the minimum and maximum keywords to specify the range of possible values:īy default, the minimum and maximum values are included in the range, that is: Note that strings containing numbers, such as "17", are considered strings and not numbers. Signed 32-bit integers (commonly used integer type). An optional format keyword serves as a hint for the tools to use a specific numeric type:įloating-point numbers with double precision. OpenAPI has two numeric types, number and integer, where number includes both integer and floating-point numbers. Mixed types can be described using oneOf and anyOf, which specify a list of alternate types: type as a list is not valid in OpenAPI (even though it is valid in JSON Schema): Note that there is no null type instead, the nullable attribute is used as a modifier of the base type.Īdditional type-specific keywords can be used to refine the data type, for example, limit the string length or specify an enum of possible values. Using these types, you can describe any data structures. These types exist in most programming languages, though they may go by different names. OpenAPI defines the following basic types: The data type of a schema is defined by the type keyword, for example, type: string. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |