Skip to content

Add complex TOML test data #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 1, 2022
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
[object]
# Comment

string = "I'm a string."
multiline_string = '''I\'m
a multiline
string'''

integer_1 = 1
integer_2 = +1
integer_3 = -1

float_1 = +1.0
float_2 = 3.1415
float_3 = -0.01
float_4 = 5e+22
float_5 = 1e06
float_6 = -2E-2
float_7 = 6.626e-34
float_8 = 224_617.445_991_228

infinite_1 = inf
infinite_2 = +inf
infinite_3 = -inf

not_a_number_1 = nan
not_a_number_2 = +nan
not_a_number_3 = -nan

hexadecimal_1 = 0xDEADBEEF
hexadecimal_2 = 0xdeadbeef
hexadecimal_3 = 0xdead_beef

octal_1 = 0o01234567
octal_2 = 0o755

binary = 0b11010110

# The null doesn't exists in TOML, but getting a value from an object
# using a non existent key will be validated against the "null" type
# null = Nil # https://github.com/toml-lang/toml/issues/30

boolean_1 = true
boolean_2 = false

# FIXME: dates can't be validated against { "type": "string", "format": "date" }
# because tomli converts them to datetime objects, must be defined as strings
# See https://json-schema.org/draft/2020-12/json-schema-validation.html#rfc.section.7.3.1
offset_datetime_1 = 1979-05-27T07:32:00Z
offset_datetime_2 = 1979-05-27T00:32:00-07:00
offset_datetime_3 = 1979-05-27T00:32:00.999999-07:00
offset_datetime_4 = '1979-05-27T07:32:00Z'
offset_datetime_5 = '1979-05-27T00:32:00-07:00'
offset_datetime_6 = '1979-05-27T00:32:00.999999-07:00'

local_datetime_1 = 1979-05-27T07:32:00
local_datetime_2 = 1979-05-27T00:32:00.999999
local_datetime_3 = '1979-05-27T07:32:00'
local_datetime_4 = '1979-05-27T00:32:00.999999'

local_date_1 = 1979-05-27
local_date_2 = '1979-05-27'

local_time_1 = 07:32:00
local_time_2 = 00:32:00.999999
local_time_3 = '07:32:00'
local_time_4 = '00:32:00.999999'

array_1 = ["a", 2, true]
array_2 = [
"b",
3.1,
false,
]

[nested_object_1]
foo = "bar"

nested_object_2 = { foo = "bar" }

[[array_of_objects_1]]
foo = "bar"
[[array_of_objects_1]]
foo = "bar"

[[nested_array_of_objects_1]]
foo = "bar"
[[nested_array_of_objects_1]]
foo = "bar"
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object",
"properties": {
"object": {
"type": "object",
"properties": {
"string": { "type": "string" },
"multiline_string": { "type": "string" },
"integer_1": { "type": "integer" },
"integer_2": { "type": "integer" },
"integer_3": { "type": "integer" },
"float_1": { "type": "number" },
"float_2": { "type": "number" },
"float_3": { "type": "number" },
"float_4": { "type": "number" },
"float_5": { "type": "number" },
"float_6": { "type": "number" },
"float_7": { "type": "number" },
"float_8": { "type": "number" },
"infinite_1": { "type": "number" },
"infinite_2": { "type": "number" },
"infinite_3": { "type": "number" },
"not_a_number_1": { "type": "number" },
"not_a_number_2": { "type": "number" },
"not_a_number_3": { "type": "number" },
"hexadecimal_1": { "type": "number" },
"hexadecimal_2": { "type": "number" },
"hexadecimal_3": { "type": "number" },
"octal_1": { "type": "number" },
"octal_2": { "type": "number" },
"binary": { "type": "number" },
"null": { "type": "null" },
"boolean_1": { "type": "boolean" },
"boolean_2": { "type": "boolean" },
"offset_datetime_4": { "type": "string", "format": "date-time" },
"offset_datetime_5": { "type": "string", "format": "date-time" },
"offset_datetime_6": { "type": "string", "format": "date-time" },
"local_datetime_4": { "type": "string", "format": "date-time" },
"local_datetime_5": { "type": "string", "format": "date-time" },
"local_date_2": { "type": "string", "format": "date" },
"local_time_3": { "type": "string", "format": "time" },
"local_time_4": { "type": "string", "format": "duration" },
"array_1": { "type": "array" },
"array_2": { "type": "array" },
"nested_object_1": {
"type": "object",
"properties": { "foo": { "type": "string" } }
},
"nested_object_2": {
"type": "object",
"properties": { "foo": { "type": "string" } }
},
"array_of_objects_1": {
"type": "array",
"items": {
"type": "object",
"properties": { "foo": { "type": "string" } }
}
},
"nested_array_of_objects_1": {
"type": "array",
"items": {
"type": "object",
"properties": { "foo": { "type": "string" } }
}
}
}
}
}
}

This file was deleted.

This file was deleted.