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 @@ -72,6 +72,7 @@ expressed as JSON Schema definitions.
| ISO/IEC | [ISO/IEC 9899:2024](https://www.iso.org/standard/82075.html) | Programming languages — C |
| JSON-RPC | [JSON-RPC 2.0](https://www.jsonrpc.org/specification) | JSON-RPC 2.0 Specification |
| JSON Schema | [Draft 2020-12](https://json-schema.org/draft/2020-12/json-schema-core) | JSON Schema: A Media Type for Describing JSON Documents |
| W3C | [XML Schema Part 2: Datatypes Second Edition](https://www.w3.org/TR/xmlschema-2/) | W3C Recommendation 28 October 2004 |

To request coverage of another standard, please [open an issue on
GitHub](https://github.com/sourcemeta/std/issues).
Expand Down
18 changes: 18 additions & 0 deletions schemas/w3c/xmlschema/2004/any-uri.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "W3C XML Schema anyURI",
"description": "The anyURI datatype represents a Uniform Resource Identifier Reference (URI) (§3.2.17)",
"examples": [
"http://www.example.com",
"https://www.example.com/path/to/resource",
"ftp://ftp.example.com/file.txt",
"mailto:user@example.com",
"../relative/path.html",
"http://www.example.com/path#fragment",
"urn:isbn:0-395-36341-1",
""
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#anyURI" ],
"$ref": "../../../ietf/uri/uri-reference.json"
}
18 changes: 18 additions & 0 deletions schemas/w3c/xmlschema/2004/base64-binary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "W3C XML Schema base64Binary",
"description": "The base64Binary datatype represents Base64-encoded arbitrary binary data (§3.2.16)",
"examples": [
"R0lGODlhAQABAAAAACw=",
"SGVsbG8gV29ybGQh",
"YQ==",
"YWI=",
"YWJj",
""
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#base64Binary" ],
"$ref": "../../../ietf/encoding/base64.json",
"contentEncoding": "base64",
"contentMediaType": "application/octet-stream"
}
9 changes: 9 additions & 0 deletions schemas/w3c/xmlschema/2004/boolean.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "W3C XML Schema boolean",
"description": "The boolean datatype represents binary logic values (§3.2.2)",
"examples": [ true, false ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#boolean" ],
"type": "boolean"
}
17 changes: 17 additions & 0 deletions schemas/w3c/xmlschema/2004/date-time.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "W3C XML Schema dateTime",
"description": "The dateTime datatype represents a specific instant of time (§3.2.7)",
"$comment": "Year 0000 is not allowed in XML Schema 1.0. Leap year validation is consumer responsibility",
"examples": [
"2002-10-10T12:00:00-05:00",
"2002-10-10T17:00:00Z",
"2002-10-10T12:00:00",
"2002-05-30T09:00:00",
"-2002-10-10T12:00:00"
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#dateTime" ],
"type": "string",
"pattern": "^-?((?!0000)[0-9]{4}-(0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01])|(?!0000)[0-9]{4}-(0[469]|11)-(0[1-9]|[12][0-9]|30)|(?!0000)[0-9]{4}-02-(0[1-9]|1[0-9]|2[0-9]))T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])?$"
}
11 changes: 11 additions & 0 deletions schemas/w3c/xmlschema/2004/date.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "W3C XML Schema date",
"description": "The date datatype represents a calendar date (§3.2.9)",
"$comment": "Year 0000 is not allowed in XML Schema 1.0. Leap year validation is consumer responsibility",
"examples": [ "2002-10-10", "2002-10-10+13:00", "2002-10-10Z", "-2002-10-10" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#date" ],
"type": "string",
"pattern": "^-?((?!0000)[0-9]{4}-(0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01])|(?!0000)[0-9]{4}-(0[469]|11)-(0[1-9]|[12][0-9]|30)|(?!0000)[0-9]{4}-02-(0[1-9]|1[0-9]|2[0-9]))(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])?$"
}
18 changes: 18 additions & 0 deletions schemas/w3c/xmlschema/2004/decimal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "W3C XML Schema decimal",
"description": "The decimal datatype represents arbitrary precision decimal numbers (§3.2.3)",
"examples": [
"-1.23",
"12678967.543233",
"+100000.00",
"210",
"0",
"-0",
"3.14159265358979323846"
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#decimal" ],
"type": "string",
"pattern": "^[+-]?([0-9]+\\.[0-9]+|[0-9]+)$"
}
16 changes: 16 additions & 0 deletions schemas/w3c/xmlschema/2004/double.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "W3C XML Schema double",
"description": "The double datatype corresponds to IEEE double-precision 64-bit floating point (§3.2.5)",
"examples": [ 0.0, 1.5, -3.14159, "INF", "-INF", "NaN" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#double" ],
"anyOf": [
{
"$ref": "../../../ieee/floating-point/2019/binary64.json"
},
{
"enum": [ "INF", "-INF", "NaN" ]
}
]
}
16 changes: 16 additions & 0 deletions schemas/w3c/xmlschema/2004/duration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "W3C XML Schema duration",
"description": "The duration datatype represents a duration of time in ISO 8601 format with optional minus sign for negative durations (§3.2.6)",
"examples": [
"P1Y2M3DT10H30M",
"-P120D",
"P1347Y",
"P1347M",
"P1Y2MT2H",
"-P1347M"
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#duration" ],
"$ref": "../../../iso/datetime/2019/duration/designator-extension.json"
}
16 changes: 16 additions & 0 deletions schemas/w3c/xmlschema/2004/float.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "W3C XML Schema float",
"description": "The float datatype corresponds to IEEE single-precision 32-bit floating point (§3.2.4)",
"examples": [ 0.0, 1.5, -3.14, "INF", "-INF", "NaN" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#float" ],
"anyOf": [
{
"$ref": "../../../ieee/floating-point/2019/binary32.json"
},
{
"enum": [ "INF", "-INF", "NaN" ]
}
]
}
10 changes: 10 additions & 0 deletions schemas/w3c/xmlschema/2004/g-day.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": "W3C XML Schema gDay",
"description": "The gDay datatype represents a day that recurs every month (§3.2.13)",
"examples": [ "---15", "---15Z", "---15+01:00", "---01", "---31" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#gDay" ],
"type": "string",
"pattern": "^---(0[1-9]|[12][0-9]|3[01])(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])?$"
}
10 changes: 10 additions & 0 deletions schemas/w3c/xmlschema/2004/g-month-day.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": "W3C XML Schema gMonthDay",
"description": "The gMonthDay datatype represents a specific day in a month (§3.2.12)",
"examples": [ "--09-14", "--09-14Z", "--09-14+01:00", "--02-29" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#gMonthDay" ],
"type": "string",
"pattern": "^(--(0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01])|--02-(0[1-9]|1[0-9]|2[0-9])|--(0[469]|11)-(0[1-9]|[12][0-9]|30))(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])?$"
}
10 changes: 10 additions & 0 deletions schemas/w3c/xmlschema/2004/g-month.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": "W3C XML Schema gMonth",
"description": "The gMonth datatype represents a month that recurs every year (§3.2.14)",
"examples": [ "--11", "--11Z", "--11+01:00", "--01", "--12" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#gMonth" ],
"type": "string",
"pattern": "^--(0[1-9]|1[0-2])(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])?$"
}
11 changes: 11 additions & 0 deletions schemas/w3c/xmlschema/2004/g-year-month.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "W3C XML Schema gYearMonth",
"description": "The gYearMonth datatype represents a specific gregorian month in a specific gregorian year (§3.2.10)",
"$comment": "Year 0000 is not allowed in XML Schema 1.0",
"examples": [ "1999-05", "1999-05Z", "1999-05+01:00", "-1999-05" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#gYearMonth" ],
"type": "string",
"pattern": "^-?(?!0000)[0-9]{4}-(0[1-9]|1[0-2])(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])?$"
}
11 changes: 11 additions & 0 deletions schemas/w3c/xmlschema/2004/g-year.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "W3C XML Schema gYear",
"description": "The gYear datatype represents a gregorian calendar year (§3.2.11)",
"$comment": "Year 0000 is not allowed in XML Schema 1.0",
"examples": [ "1999", "1999Z", "1999+01:00", "-1999" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#gYear" ],
"type": "string",
"pattern": "^-?(?!0000)[0-9]{4}(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])?$"
}
9 changes: 9 additions & 0 deletions schemas/w3c/xmlschema/2004/hex-binary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "W3C XML Schema hexBinary",
"description": "The hexBinary datatype represents arbitrary hex-encoded binary data (§3.2.15)",
"examples": [ "0FB7", "0fb7", "0123456789ABCDEF", "DEADBEEF", "" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#hexBinary" ],
"$ref": "../../../ietf/encoding/base16.json"
}
9 changes: 9 additions & 0 deletions schemas/w3c/xmlschema/2004/string.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "W3C XML Schema string",
"description": "The string datatype represents character strings in XML (§3.2.1)",
"examples": [ "Hello World", "", "Line 1\nLine 2", "Multiple spaces" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#string" ],
"type": "string"
}
17 changes: 17 additions & 0 deletions schemas/w3c/xmlschema/2004/time.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "W3C XML Schema time",
"description": "The time datatype represents an instant of time that recurs every day (§3.2.8)",
"$comment": "Hour 24 is only valid as 24:00:00",
"examples": [
"13:20:00-05:00",
"13:20:00Z",
"13:20:00",
"00:00:00",
"24:00:00"
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.w3.org/TR/xmlschema-2/#time" ],
"type": "string",
"pattern": "^(([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?|24:00:00)(Z|[+-]([01][0-9]|2[0-3]):[0-5][0-9])?$"
}
Loading