Types

apidoc supports types that are common on the web - and useful for many web applications. For example, many applications work with dates and date times - by explicitly supporting these types, we can simplify working with these types in all web applications, and for type safe languages, we can map to the appropriate classes in each language.

boolean

  • Represents a boolean value

  • Examples:
    • true
    • false

date-iso8601

  • Date format in ISO 8601

  • Examples:
    • 2014-04-29

date-time-iso8601

  • Date time format in ISO 8601

  • Examples:
    • 2014-04-29T11:56:52Z

decimal

  • Commonly used to represent things like currency values. Maps to a BigDecimal in most languages.

  • Examples:
    • 10.12
    • 0.00
    • -10.12

double

  • double precision IEEE 754 floating-point number

  • Examples:
    • 10.12
    • 0.00
    • -10.12

integer

  • 32-bit signed integer

  • Examples:
    • 10
    • 0
    • -10

long

  • 64-bit signed integer

  • Examples:
    • 10
    • 0
    • -10

object

  • Represents an arbitrary json object. In scala clients using play-json, maps to a play.api.libs.json.JsObject. In ruby clients, JSON is parsed into a hash

  • Examples:
    • {}

string

  • unicode character sequence

  • Examples:
    • This is a fox.

unit

  • Internal type used to represent things like an HTTP NoContent response. Maps to void in Java, Unit in Scala, nil in ruby, etc.

uuid

  • String representation of a universally unique identifier

  • Examples:
    • 5ecf6502-e532-4738-aad5-7ac9701251dd