Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func ExampleReflect() {
// Output:
// {
// "$schema": "https://json-schema.org/draft/2020-12/schema",
// "$id": "https://github.com/invopop/jsonschema_test/SampleUser",
// "$id": "https://github.com/invopop/jsonschema_test/sample-user",
// "$ref": "#/$defs/SampleUser",
// "$defs": {
// "SampleUser": {
Expand Down
4 changes: 2 additions & 2 deletions fixtures/allow_additional_props.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/TestUser",
"$id": "https://github.com/invopop/jsonschema/test-user",
"$ref": "#/$defs/TestUser",
"$defs": {
"Bytes": {
Expand Down Expand Up @@ -226,4 +226,4 @@
]
}
}
}
}
4 changes: 2 additions & 2 deletions fixtures/anyof.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/RootAnyOf",
"$id": "https://github.com/invopop/jsonschema/root-any-of",
"$ref": "#/$defs/RootAnyOf",
"$defs": {
"ChildAnyOf": {
Expand Down Expand Up @@ -88,4 +88,4 @@
"type": "object"
}
}
}
}
4 changes: 2 additions & 2 deletions fixtures/array_type.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/ArrayType",
"$id": "https://github.com/invopop/jsonschema/array-type",
"$ref": "#/$defs/ArrayType",
"$defs": {
"ArrayType": {
Expand All @@ -10,4 +10,4 @@
"type": "array"
}
}
}
}
4 changes: 2 additions & 2 deletions fixtures/base_schema_id.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/schemas/LookupUser",
"$id": "https://example.com/schemas/lookup-user",
"$ref": "#/$defs/LookupUser",
"$defs": {
"LookupName": {
Expand Down Expand Up @@ -35,4 +35,4 @@
]
}
}
}
}
4 changes: 2 additions & 2 deletions fixtures/commas_in_pattern.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/PatternTest",
"$id": "https://github.com/invopop/jsonschema/pattern-test",
"$ref": "#/$defs/PatternTest",
"$defs": {
"PatternTest": {
Expand All @@ -19,4 +19,4 @@
]
}
}
}
}
4 changes: 2 additions & 2 deletions fixtures/compact_date.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/CompactDate",
"$id": "https://github.com/invopop/jsonschema/compact-date",
"$ref": "#/$defs/CompactDate",
"$defs": {
"CompactDate": {
Expand All @@ -10,4 +10,4 @@
"description": "Short date that only includes year and month"
}
}
}
}
4 changes: 2 additions & 2 deletions fixtures/custom_additional.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/GrandfatherType",
"$id": "https://github.com/invopop/jsonschema/grandfather-type",
"$ref": "#/$defs/GrandfatherType",
"$defs": {
"GrandfatherType": {
Expand All @@ -21,4 +21,4 @@
]
}
}
}
}
4 changes: 2 additions & 2 deletions fixtures/custom_map_type.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/CustomMapOuter",
"$id": "https://github.com/invopop/jsonschema/custom-map-outer",
"$ref": "#/$defs/CustomMapOuter",
"$defs": {
"CustomMapOuter": {
Expand Down Expand Up @@ -34,4 +34,4 @@
"type": "array"
}
}
}
}
4 changes: 2 additions & 2 deletions fixtures/custom_slice_type.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/CustomSliceOuter",
"$id": "https://github.com/invopop/jsonschema/custom-slice-outer",
"$ref": "#/$defs/CustomSliceOuter",
"$defs": {
"CustomSliceOuter": {
Expand Down Expand Up @@ -29,4 +29,4 @@
]
}
}
}
}
4 changes: 2 additions & 2 deletions fixtures/custom_type.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/CustomTypeField",
"$id": "https://github.com/invopop/jsonschema/custom-type-field",
"$ref": "#/$defs/CustomTypeField",
"$defs": {
"CustomTypeField": {
Expand All @@ -17,4 +17,4 @@
]
}
}
}
}
4 changes: 2 additions & 2 deletions fixtures/custom_type_extend.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/SchemaExtendTest",
"$id": "https://github.com/invopop/jsonschema/schema-extend-test",
"$ref": "#/$defs/SchemaExtendTest",
"$defs": {
"SchemaExtendTest": {
Expand All @@ -20,4 +20,4 @@
]
}
}
}
}
4 changes: 2 additions & 2 deletions fixtures/custom_type_with_interface.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/CustomTypeFieldWithInterface",
"$id": "https://github.com/invopop/jsonschema/custom-type-field-with-interface",
"$ref": "#/$defs/CustomTypeFieldWithInterface",
"$defs": {
"CustomTimeWithInterface": {
Expand All @@ -20,4 +20,4 @@
]
}
}
}
}
4 changes: 2 additions & 2 deletions fixtures/defaults_expanded_toplevel.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/TestUser",
"$id": "https://github.com/invopop/jsonschema/test-user",
"$defs": {
"Bytes": {
"type": "string",
Expand Down Expand Up @@ -225,4 +225,4 @@
"roles",
"raw"
]
}
}
4 changes: 2 additions & 2 deletions fixtures/go_comments.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/examples/User",
"$id": "https://github.com/invopop/jsonschema/examples/user",
"$ref": "#/$defs/User",
"$defs": {
"NamedPets": {
Expand Down Expand Up @@ -106,4 +106,4 @@
"description": "User is used as a base to provide tests for comments."
}
}
}
}
4 changes: 2 additions & 2 deletions fixtures/ignore_type.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/TestUser",
"$id": "https://github.com/invopop/jsonschema/test-user",
"$ref": "#/$defs/TestUser",
"$defs": {
"Bytes": {
Expand Down Expand Up @@ -221,4 +221,4 @@
]
}
}
}
}
4 changes: 2 additions & 2 deletions fixtures/inlining_embedded.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/OuterNamed",
"$id": "https://github.com/invopop/jsonschema/outer-named",
"$defs": {
"Inner": {
"properties": {
Expand Down Expand Up @@ -28,4 +28,4 @@
"required": [
"inner"
]
}
}
4 changes: 2 additions & 2 deletions fixtures/inlining_embedded_anchored.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/OuterNamed",
"$id": "https://github.com/invopop/jsonschema/outer-named",
"$anchor": "OuterNamed",
"$defs": {
"Inner": {
Expand Down Expand Up @@ -30,4 +30,4 @@
"required": [
"inner"
]
}
}
4 changes: 2 additions & 2 deletions fixtures/inlining_inheritance.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/Outer",
"$id": "https://github.com/invopop/jsonschema/outer",
"properties": {
"TextNamed": {
"type": "string"
Expand All @@ -18,4 +18,4 @@
"TextNamed",
"Foo"
]
}
}
4 changes: 2 additions & 2 deletions fixtures/inlining_ptr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/OuterPtr",
"$id": "https://github.com/invopop/jsonschema/outer-ptr",
"properties": {
"Foo": {
"type": "string"
Expand All @@ -14,4 +14,4 @@
"required": [
"Foo"
]
}
}
4 changes: 2 additions & 2 deletions fixtures/keynamed.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/KeyNamed",
"$id": "https://github.com/invopop/jsonschema/key-named",
"$ref": "#/$defs/KeyNamed",
"$defs": {
"KeyNamed": {
Expand Down Expand Up @@ -49,4 +49,4 @@
]
}
}
}
}
6 changes: 3 additions & 3 deletions fixtures/lookup.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/schemas/LookupUser",
"$id": "https://example.com/schemas/lookup-user",
"$ref": "#/$defs/LookupUser",
"$defs": {
"LookupUser": {
"properties": {
"name": {
"$ref": "https://example.com/schemas/LookupName"
"$ref": "https://example.com/schemas/lookup-name"
},
"alias": {
"type": "string"
Expand All @@ -19,4 +19,4 @@
]
}
}
}
}
6 changes: 3 additions & 3 deletions fixtures/lookup_expanded.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/schemas/LookupUser",
"$id": "https://example.com/schemas/lookup-user",
"$anchor": "LookupUser",
"properties": {
"name": {
"$ref": "https://example.com/schemas/LookupName"
"$ref": "https://example.com/schemas/lookup-name"
},
"alias": {
"type": "string"
Expand All @@ -15,4 +15,4 @@
"required": [
"name"
]
}
}
4 changes: 2 additions & 2 deletions fixtures/map_type.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/MapType",
"$id": "https://github.com/invopop/jsonschema/map-type",
"$ref": "#/$defs/MapType",
"$defs": {
"MapType": {
"type": "object"
}
}
}
}
4 changes: 2 additions & 2 deletions fixtures/no_reference.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/TestUser",
"$id": "https://github.com/invopop/jsonschema/test-user",
"properties": {
"id": {
"type": "integer"
Expand Down Expand Up @@ -214,4 +214,4 @@
"roles",
"raw"
]
}
}
4 changes: 2 additions & 2 deletions fixtures/no_reference_anchor.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/invopop/jsonschema/TestUser",
"$id": "https://github.com/invopop/jsonschema/test-user",
"$anchor": "TestUser",
"properties": {
"id": {
Expand Down Expand Up @@ -216,4 +216,4 @@
"roles",
"raw"
]
}
}
Loading