-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support referencing other schemas that have no output file.
- Loading branch information
1 parent
d61cc2a
commit caafad8
Showing
6 changed files
with
76 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"id": "https://example.com/other", | ||
"definitions": { | ||
"Thing": { | ||
"type": "object", | ||
"properties": { | ||
"s": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. | ||
|
||
package schema | ||
|
||
import other "github.com/example/other" | ||
|
||
type Thing struct { | ||
// S corresponds to the JSON schema field "s". | ||
S *string `json:"s,omitempty"` | ||
} | ||
|
||
type Schema struct { | ||
// DefInOtherSchema corresponds to the JSON schema field "defInOtherSchema". | ||
DefInOtherSchema *other.Thing `json:"defInOtherSchema,omitempty"` | ||
|
||
// DefInSameSchema corresponds to the JSON schema field "defInSameSchema". | ||
DefInSameSchema *Thing `json:"defInSameSchema,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema#", | ||
"id": "https://example.com/schema", | ||
"type": "object", | ||
"properties": { | ||
"defInSameSchema": { | ||
"$ref": "#/Definitions/Thing" | ||
}, | ||
"defInOtherSchema": { | ||
"$ref": "other.json#/Definitions/Thing" | ||
} | ||
}, | ||
"definitions": { | ||
"Thing": { | ||
"type": "object", | ||
"properties": { | ||
"s": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters