-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expands the usage of the `@title` trait to allow application to any non-member shape.
- Loading branch information
Showing
5 changed files
with
86 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
44 changes: 44 additions & 0 deletions
44
...hema/src/test/resources/software/amazon/smithy/jsonschema/title-added.jsonschema.v07.json
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,44 @@ | ||
{ | ||
"definitions": { | ||
"Foo": { | ||
"type": "object", | ||
"properties": { | ||
"bam": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"title": "A list of strings", | ||
"default": [] | ||
}, | ||
"bar": { | ||
"type": "number", | ||
"default": 0 | ||
}, | ||
"bat": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/TestEnum" | ||
}, | ||
{ | ||
"default": "FOO" | ||
} | ||
] | ||
}, | ||
"baz": { | ||
"type": "string", | ||
"default": "" | ||
} | ||
}, | ||
"title": "A structure" | ||
}, | ||
"TestEnum": { | ||
"type": "string", | ||
"enum": [ | ||
"FOO", | ||
"BAR" | ||
], | ||
"title": "A Test Enum!" | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
smithy-jsonschema/src/test/resources/software/amazon/smithy/jsonschema/title-added.smithy
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,22 @@ | ||
$version: "2.0" | ||
|
||
namespace smithy.example | ||
|
||
@title("A structure") | ||
structure Foo { | ||
bar: Integer = 0 | ||
baz: String = "" | ||
bam: StringList = [], | ||
bat: TestEnum = "FOO" | ||
} | ||
|
||
@title("A list of strings") | ||
list StringList { | ||
member: String | ||
} | ||
|
||
@title("A Test Enum!") | ||
enum TestEnum { | ||
FOO | ||
BAR | ||
} |
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