Fix enum member trait parsing
The clearPendingDocs call was made after consuming traits that follow a previous enum member. Fixed by calling it in the right order.
This commit is contained in:
parent
ec76181ebd
commit
919d547bb2
|
@ -621,11 +621,11 @@ final class IdlModelParser extends SimpleParser {
|
|||
sp();
|
||||
Node value = IdlNodeParser.parseNode(this);
|
||||
memberBuilder.addTrait(new EnumValueTrait.Provider().createTrait(memberBuilder.getId(), value));
|
||||
clearPendingDocs();
|
||||
br();
|
||||
} else {
|
||||
ws();
|
||||
}
|
||||
|
||||
clearPendingDocs();
|
||||
ws();
|
||||
}
|
||||
|
||||
expect('}');
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"smithy": "2.0",
|
||||
"shapes": {
|
||||
"smithy.example#Foo": {
|
||||
"type": "enum",
|
||||
"members": {
|
||||
"BAR": {
|
||||
"target": "smithy.api#Unit",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Hello1",
|
||||
"smithy.api#enumValue": "hi"
|
||||
}
|
||||
},
|
||||
"BAZ": {
|
||||
"target": "smithy.api#Unit",
|
||||
"traits": {
|
||||
"smithy.api#documentation": "Hello2",
|
||||
"smithy.api#enumValue": "there"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
$version: "2.0"
|
||||
namespace smithy.example
|
||||
|
||||
enum Foo {
|
||||
/// Hello1
|
||||
BAR = "hi"
|
||||
|
||||
/// Hello2
|
||||
BAZ = "there"
|
||||
}
|
Loading…
Reference in New Issue