Data Formats
When generating API models, the Akita Agent will identify common data formats, like dates, times, and URLs. When Akita learns that a parameter's value matches a known data format, it adds an x-akita-format
annotation to the parameter.
The x-akita-format
annotation has two parts, the kind
of data format (like datetime
) as well as any specific formats (such as the RFC3339
format for dates and times, or the Unix timestamp format of seconds after the epoch). The kinds and formats that SuperLearn supports are listed below.
Please let us know if there are additional data formats you would like to see. We have also gotten requests for introducing custom data formats. They are on our roadmap! (But please still let us know if you are interested.)
Kinds
Kind | Description |
country | Countries of the world, including native and English spellings and country codes. |
currency_name | Names of currencies, including native and English spellings and abbreviations. |
datetime | Dates, times, and timestamps. |
email | Email addresses. |
language | Written and spoken languages, including native and English spellings. |
phone_number | Telephone numbers. |
uri | URLs and other uniform resource identifiers. |
country
Format | Description | Examples |
country_code_2 | ISO 3166 Alpha-2 two-letter country code. | - "AD" (Andorra)- "US" (United States of America) |
country_code_3 | ISO 3166 Alpha-3 three-letter country code. | - "AND" (Andorra)- "USA" (United States of America) |
country_name | Country name as expressed in that country. | - "افغانستان" (Afghanistan)- "España" (Spain)- "United States of America" |
country_name_english | Country name in English. | "Spain" |
top_level_domain | Top level domain name. | - ".ad" (Andorra)- ".us" (United States of America) |
currency_name
Format | Description | Examples |
currency_name_english | Currency name in English. | - "Euro" - "United States dollar" |
currency_abbreviation | Currency name, abbreviated. | - "EUR" (Euro)- "USD" (United States dollar) |
datetime
Format | Description | Examples |
ansi_c_datetime | Date and time as returned by ANSI C date and time functions, like ctime . | "Mon Jan _2 15:04:05 2006" |
go_timestamp | The Go language's handy time stamp. | "Jan 2 15:04:05" |
go_timestamp_micro | The Go language's handy time stamp, with microsecond precision. | "Jan 2 15:04:05.000000" |
go_timestamp_milli | The Go language's handy time stamp, with millisecond precision. | "Jan 2 15:04:05.000" |
iso_8601_year_month | YYYY-MM date, as described by the ISO 8601 standard. | "2006-01" |
iso_8601_year_month_day | YYYY-MM-DD date, as described by the ISO 8601 standard. | "2006-01-02 " |
kitchen_clock | Time as commonly seen on a stove or microwave. | "3:04PM" |
rfc_2822 | Date and time as specified by RFC 2822. | - "02 Jan 2006 15:04 MST" - "Mon, 02 Jan 2006 15:04:05 MST" |
rfc_2822z | Date and time as specified by RFC 2822, with numeric timezone. | - "02 Jan 2006 15:04 -0700" - "Mon, 02 Jan 2006 15:04:05 -0700" |
rfc_822 | Date and time as specified by RFC 822. This is a subset of the date/time formats accepted by RFC 2822. | "02 Jan 06 15:04 MST" |
rfc_822z | Date and time as specified by RFC 822, with numeric timezone. This is a subset of the date/time formats accepted by RFC 2822. | "02 Jan 06 15:04 -0700" |
rfc_850 | Date and time as specified by RFC 850. | "Monday, 02-Jan-06 15:04:05 MST" |
rfc_3339 | Date and time as specified by RFC 3339. | "2006-01-02T15:04:05Z07:00" |
ruby_datetime | Date and time as rendered by Ruby's DateTime library. | "Mon Jan 02 15:04:05 -0700 2006" |
timestamp_milliseconds_since_epoch | Timestamp represented as milliseconds since the Unix Epoch (00:00:00 UTC on 1 January 1970). | "1596597629980" |
timestamp_nanoseconds_since_epoch | Timestamp represented as nanoseconds since the Unix Epoch (00:00:00 UTC on 1 January 1970). | "1596597839946364285" |
timestamp_seconds_since_epoch | Timestamp represented as seconds since the Unix Epoch (00:00:00 UTC on 1 January 1970). | "1596597629" |
timezone_utc_offset | Timezone represented as offset from UTC. | "UTC-07:00" |
email
Format | Description | Examples |
rfc_5322_email | An email address, as defined by RFC 5322. | - [email protected] - [email protected] - [email protected] |
rfc_5322_name_email | An email address accompanied by a name, as defined by RFC 5322. | - Example Name <[email protected]> - "Example S. Name <[email protected]> |
language
Format | Description | Examples |
iso_693_1 | Two-letter abbreviation of language name, as specified by ISO 693-1. | - "ab" (Abkhazian)- "en" (English) |
iso_693_2 | Three-letter abbreviation of language name, as specified by ISO 693-2. | - "abk" (Abkhazian)- "eng" (English) |
language_name | Language name, as expressed natively. | - "پښتو" (Pashto)- "Español" (Spanish)- 'Oʻzbek" (Uzbek)- "English" (English) |
language_name_english | Language name in English. | "Spanish" |
phone_number
Format | Description | Examples |
phone_number_international | International telephone number, including the international calling code. Supports ' ', '-', '.' as separators. | - +1 684-633-5115 (American Samoa)- +49 30 83050 (German)- +355 4 224 7285 (Albania)- +1 323-867-5309 (United States) |
phone_number_us | United States phone number, including area code but excluding international calling code. Supports a variety of separators, see examples. | - 323-867-5309 - 323 867 5309 - 323.867.5309 - (323) 867-5309 - (323) 867 5309 - 3238675309 |
uri
Format | Description | Examples |
url | Absolute URL, including HTTP or HTTPS protocol, trailing paths, and/or anchors. | - https://www.example.com - https://www.example.com/foo - https://www.example.com/foo#bar |
Updated about 2 years ago