Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ expressed as JSON Schema definitions.
| IETF | [RFC 8141](https://www.rfc-editor.org/rfc/rfc8141) | Uniform Resource Names (URNs) |
| IETF | [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110) | HTTP Semantics |
| ISO | [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) | Codes for the representation of currencies and funds |
| ISO | [ISO 8601-1:2019](https://www.iso.org/standard/70907.html) | Date and time — Representations for information interchange — Part 1: Basic rules |
| ISO | [ISO 80000-1:2022](https://www.iso.org/standard/76921.html) | Quantities and units — Part 1: General |
| ISO/IEC | [ISO/IEC 2382:2015](https://www.iso.org/standard/63598.html) | Information technology — Vocabulary |
| JSON-RPC | [JSON-RPC 2.0](https://www.jsonrpc.org/specification) | JSON-RPC 2.0 Specification |
Expand Down
10 changes: 10 additions & 0 deletions schemas/iso/datetime/2019/duration-calendar-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Duration (Alternative Calendar Basic Format)",
"description": "A duration in alternative basic format P[YYYYMMDD]T[HHMMSS] (§5.5.2.4)",
"$comment": "https://www.iso.org/standard/70907.html",
"examples": [ "P00020110T223355", "P00010101T000000", "P00001231T235959" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"type": "string",
"pattern": "^P(?:[0-9]{4}|[+-][0-9]{5,})(?:0[1-9]|1[0-2])(?:0[1-9]|[12][0-9]|3[01])T(?:[01][0-9]|2[0-3])(?:[0-5][0-9])(?:[0-5][0-9])$"
}
14 changes: 14 additions & 0 deletions schemas/iso/datetime/2019/duration-calendar-extended.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Duration (Alternative Calendar Extended Format)",
"description": "A duration in alternative extended format P[YYYY-MM-DD]T[HH:MM:SS] (§5.5.2.4)",
"$comment": "https://www.iso.org/standard/70907.html",
"examples": [
"P0002-01-10T22:33:55",
"P0001-01-01T00:00:00",
"P0001-12-31T23:59:59"
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"type": "string",
"pattern": "^P(?:[0-9]{4}|[+-][0-9]{5,})-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12][0-9]|3[01])T(?:[01][0-9]|2[0-3]):(?:[0-5][0-9]):(?:[0-5][0-9])$"
}
223 changes: 223 additions & 0 deletions schemas/iso/datetime/2019/duration-designator.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Duration (Designator Format)",
"description": "A duration in designator format P[n]Y[n]M[n]DT[n]H[n]M[n]S (§5.5.2.2, §5.5.2.3)",
"$comment": "https://www.iso.org/standard/70907.html",
"examples": [
"P3Y6M4DT12H30M5S",
"P1Y",
"PT1H",
"P1DT1S",
"P0Y0M0DT0H0M0S",
"P1.5Y",
"PT0.5H"
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"type": "string",
"allOf": [
{
"not": {
"const": "P"
}
},
{
"not": {
"const": "PT"
}
}
],
"anyOf": [
{
"$comment": "Date-only: Years with decimal (lowest order)",
"pattern": "^P[0-9]+(?:\\.[0-9]+)?Y$"
},
{
"$comment": "Date-only: Years (integer) + Months with decimal (lowest order)",
"pattern": "^P[0-9]+Y[0-9]+(?:\\.[0-9]+)?M$"
},
{
"$comment": "Date-only: Years (integer) + Months (integer) + Days with decimal (lowest order)",
"pattern": "^P[0-9]+Y[0-9]+M[0-9]+(?:\\.[0-9]+)?D$"
},
{
"$comment": "Date-only: Months with decimal (lowest order)",
"pattern": "^P[0-9]+(?:\\.[0-9]+)?M$"
},
{
"$comment": "Date-only: Months (integer) + Days with decimal (lowest order)",
"pattern": "^P[0-9]+M[0-9]+(?:\\.[0-9]+)?D$"
},
{
"$comment": "Date-only: Days with decimal (lowest order)",
"pattern": "^P[0-9]+(?:\\.[0-9]+)?D$"
},
{
"$comment": "Time-only: Hours with decimal (lowest order)",
"pattern": "^PT[0-9]+(?:\\.[0-9]+)?H$"
},
{
"$comment": "Time-only: Hours (integer) + Minutes with decimal (lowest order)",
"pattern": "^PT[0-9]+H[0-9]+(?:\\.[0-9]+)?M$"
},
{
"$comment": "Time-only: Hours (integer) + Minutes (integer) + Seconds with decimal (lowest order)",
"pattern": "^PT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Time-only: Minutes with decimal (lowest order)",
"pattern": "^PT[0-9]+(?:\\.[0-9]+)?M$"
},
{
"$comment": "Time-only: Minutes (integer) + Seconds with decimal (lowest order)",
"pattern": "^PT[0-9]+M[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Time-only: Seconds with decimal (lowest order)",
"pattern": "^PT[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Years + Hours with decimal (lowest order)",
"pattern": "^P[0-9]+YT[0-9]+(?:\\.[0-9]+)?H$"
},
{
"$comment": "Date+Time: Years + Hours (integer) + Minutes with decimal (lowest order)",
"pattern": "^P[0-9]+YT[0-9]+H[0-9]+(?:\\.[0-9]+)?M$"
},
{
"$comment": "Date+Time: Years + Hours (integer) + Minutes (integer) + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+YT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Years + Minutes with decimal (lowest order)",
"pattern": "^P[0-9]+YT[0-9]+(?:\\.[0-9]+)?M$"
},
{
"$comment": "Date+Time: Years + Minutes (integer) + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+YT[0-9]+M[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Years + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+YT[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Years (integer) + Months + Hours with decimal (lowest order)",
"pattern": "^P[0-9]+Y[0-9]+MT[0-9]+(?:\\.[0-9]+)?H$"
},
{
"$comment": "Date+Time: Years (integer) + Months + Hours (integer) + Minutes with decimal (lowest order)",
"pattern": "^P[0-9]+Y[0-9]+MT[0-9]+H[0-9]+(?:\\.[0-9]+)?M$"
},
{
"$comment": "Date+Time: Years (integer) + Months + Hours (integer) + Minutes (integer) + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+Y[0-9]+MT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Years (integer) + Months + Minutes with decimal (lowest order)",
"pattern": "^P[0-9]+Y[0-9]+MT[0-9]+(?:\\.[0-9]+)?M$"
},
{
"$comment": "Date+Time: Years (integer) + Months + Minutes (integer) + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+Y[0-9]+MT[0-9]+M[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Years (integer) + Months + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+Y[0-9]+MT[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Years (integer) + Months (integer) + Days + Hours with decimal (lowest order)",
"pattern": "^P[0-9]+Y[0-9]+M[0-9]+DT[0-9]+(?:\\.[0-9]+)?H$"
},
{
"$comment": "Date+Time: Years (integer) + Months (integer) + Days + Hours (integer) + Minutes with decimal (lowest order)",
"pattern": "^P[0-9]+Y[0-9]+M[0-9]+DT[0-9]+H[0-9]+(?:\\.[0-9]+)?M$"
},
{
"$comment": "Date+Time: Years (integer) + Months (integer) + Days + Hours (integer) + Minutes (integer) + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+Y[0-9]+M[0-9]+DT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Years (integer) + Months (integer) + Days + Minutes with decimal (lowest order)",
"pattern": "^P[0-9]+Y[0-9]+M[0-9]+DT[0-9]+(?:\\.[0-9]+)?M$"
},
{
"$comment": "Date+Time: Years (integer) + Months (integer) + Days + Minutes (integer) + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+Y[0-9]+M[0-9]+DT[0-9]+M[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Years (integer) + Months (integer) + Days + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+Y[0-9]+M[0-9]+DT[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Months + Hours with decimal (lowest order)",
"pattern": "^P[0-9]+MT[0-9]+(?:\\.[0-9]+)?H$"
},
{
"$comment": "Date+Time: Months + Hours (integer) + Minutes with decimal (lowest order)",
"pattern": "^P[0-9]+MT[0-9]+H[0-9]+(?:\\.[0-9]+)?M$"
},
{
"$comment": "Date+Time: Months + Hours (integer) + Minutes (integer) + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+MT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Months + Minutes with decimal (lowest order)",
"pattern": "^P[0-9]+MT[0-9]+(?:\\.[0-9]+)?M$"
},
{
"$comment": "Date+Time: Months + Minutes (integer) + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+MT[0-9]+M[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Months + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+MT[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Months (integer) + Days + Hours with decimal (lowest order)",
"pattern": "^P[0-9]+M[0-9]+DT[0-9]+(?:\\.[0-9]+)?H$"
},
{
"$comment": "Date+Time: Months (integer) + Days + Hours (integer) + Minutes with decimal (lowest order)",
"pattern": "^P[0-9]+M[0-9]+DT[0-9]+H[0-9]+(?:\\.[0-9]+)?M$"
},
{
"$comment": "Date+Time: Months (integer) + Days + Hours (integer) + Minutes (integer) + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+M[0-9]+DT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Months (integer) + Days + Minutes with decimal (lowest order)",
"pattern": "^P[0-9]+M[0-9]+DT[0-9]+(?:\\.[0-9]+)?M$"
},
{
"$comment": "Date+Time: Months (integer) + Days + Minutes (integer) + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+M[0-9]+DT[0-9]+M[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Months (integer) + Days + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+M[0-9]+DT[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Days + Hours with decimal (lowest order)",
"pattern": "^P[0-9]+DT[0-9]+(?:\\.[0-9]+)?H$"
},
{
"$comment": "Date+Time: Days + Hours (integer) + Minutes with decimal (lowest order)",
"pattern": "^P[0-9]+DT[0-9]+H[0-9]+(?:\\.[0-9]+)?M$"
},
{
"$comment": "Date+Time: Days + Hours (integer) + Minutes (integer) + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+DT[0-9]+H[0-9]+M[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Days + Minutes with decimal (lowest order)",
"pattern": "^P[0-9]+DT[0-9]+(?:\\.[0-9]+)?M$"
},
{
"$comment": "Date+Time: Days + Minutes (integer) + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+DT[0-9]+M[0-9]+(?:\\.[0-9]+)?S$"
},
{
"$comment": "Date+Time: Days + Seconds with decimal (lowest order)",
"pattern": "^P[0-9]+DT[0-9]+(?:\\.[0-9]+)?S$"
}
]
}
10 changes: 10 additions & 0 deletions schemas/iso/datetime/2019/duration-ordinal-basic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Duration (Alternative Ordinal Basic Format)",
"description": "A duration in alternative basic format with ordinal date P[YYYYDDD]T[HHMMSS] (§5.5.2.4)",
"$comment": "https://www.iso.org/standard/70907.html",
"examples": [ "P0002178T223355", "P0001001T000000", "P0001365T235959" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"type": "string",
"pattern": "^P(?:[0-9]{4}|[+-][0-9]{5,})(?:0[0-9][1-9]|0[1-9][0-9]|[12][0-9]{2}|3[0-5][0-9]|36[0-6])T(?:[01][0-9]|2[0-3])(?:[0-5][0-9])(?:[0-5][0-9])$"
}
14 changes: 14 additions & 0 deletions schemas/iso/datetime/2019/duration-ordinal-extended.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Duration (Alternative Ordinal Extended Format)",
"description": "A duration in alternative extended format with ordinal date P[YYYY-DDD]T[HH:MM:SS] (§5.5.2.4)",
"$comment": "https://www.iso.org/standard/70907.html",
"examples": [
"P0002-178T22:33:55",
"P0001-001T00:00:00",
"P0001-365T23:59:59"
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"type": "string",
"pattern": "^P(?:[0-9]{4}|[+-][0-9]{5,})-(?:0[0-9][1-9]|0[1-9][0-9]|[12][0-9]{2}|3[0-5][0-9]|36[0-6])T(?:[01][0-9]|2[0-3]):(?:[0-5][0-9]):(?:[0-5][0-9])$"
}
10 changes: 10 additions & 0 deletions schemas/iso/datetime/2019/duration-weeks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ISO 8601-1:2019 Duration (Weeks Format)",
"description": "A duration in complete representation with weeks format P[n]W (§5.5.2.2)",
"$comment": "https://www.iso.org/standard/70907.html",
"examples": [ "P10W", "P1W", "P52W", "P0W", "P1.5W" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"type": "string",
"pattern": "^P[0-9]+(?:\\.[0-9]+)?W$"
}
Loading