Skip to content
Open
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
2 changes: 1 addition & 1 deletion docs/source-2.0/spec/documentation-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ tags trait are arbitrary and up to the model author.
===============

Summary
Defines a proper name for a service or resource shape. This title can be
Defines a proper name for a shape. This title can be
used in automatically generated documentation and other contexts to
provide a user friendly name for a shape.
Trait selector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,13 @@ public Schema enumShape(EnumShape shape) {
MemberShape member = entry.getValue();
Schema enumSchema = Schema.builder()
.constValue(StringNode.from(enumValues.get(memberName)))
.title(member.getTrait(TitleTrait.class)
.map(TitleTrait::getValue)
.orElse(null))
.description(member.getTrait(DocumentationTrait.class)
.map(DocumentationTrait::getValue)
.orElse(null))

.build();

schemas.add(enumSchema);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"description": "it really does foo"
},
{
"const": "Bar"
"const": "Bar",
"title": "TestEnum Bar"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ structure Foo {
enum TestEnum {
@documentation("it really does foo")
FOO = "Foo"
@title("TestEnum Bar")
BAR = "Bar"
}
Original file line number Diff line number Diff line change
Expand Up @@ -666,11 +666,11 @@ list tags {
member: String
}

/// Defines a proper name for a service or resource shape.
/// Defines a proper name for a shape.
///
/// This title can be used in automatically generated documentation
/// and other contexts to provide a user friendly for shapes.
@trait(selector: ":not(member)")
/// and other contexts to provide a user-friendly for shapes.
@trait
string title

/// Constrains the acceptable values of a string to a fixed set
Expand Down
Loading