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: 2 additions & 0 deletions private/my-local-model/src/commands/GetNumbersCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export interface GetNumbersCommandOutput extends GetNumbersResponse, __MetadataB
* const input = { // GetNumbersRequest
* bigDecimal: Number("bigdecimal"),
* bigInteger: Number("bigint"),
* fieldWithoutMessage: "STRING_VALUE",
* fieldWithMessage: "STRING_VALUE",
* };
* const command = new GetNumbersCommand(input);
* const response = await client.send(command);
Expand Down
15 changes: 15 additions & 0 deletions private/my-local-model/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@ export class CodedThrottlingError extends __BaseException {
export interface GetNumbersRequest {
bigDecimal?: NumericValue | undefined;
bigInteger?: bigint | undefined;
/**
* This is deprecated documentation annotation
*
* @deprecated see description
* @public
*/
fieldWithoutMessage?: string | undefined;

/**
* This is deprecated documentation annotation
*
* @deprecated This field has been deprecated
* @public
*/
fieldWithMessage?: string | undefined;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions private/my-local-model/src/protocols/Rpcv2cbor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ const se_GetNumbersRequest = (input: GetNumbersRequest, context: __SerdeContext)
return take(input, {
bigDecimal: __nv,
bigInteger: [],
fieldWithMessage: [],
fieldWithoutMessage: [],
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,9 @@ boolean writeShapeDocs(Shape shape, UnaryOperator<String> preprocessor) {
if (shape.getTrait(DeprecatedTrait.class).isPresent()) {
DeprecatedTrait deprecatedTrait = shape.expectTrait(DeprecatedTrait.class);
String deprecationMessage = deprecatedTrait.getMessage()
.map(msg -> " " + msg)
.orElse("");
String deprecationString = "@deprecated" + deprecationMessage;
docs = docs + "\n\n" + deprecationString;
.orElse("deprecated");
String deprecationAnnotation = "@deprecated " + deprecationMessage;
docs = docs + "\n\n" + deprecationAnnotation;
}
docs = preprocessor.apply(docs);
docs = addReleaseTag(shape, docs);
Expand Down Expand Up @@ -266,7 +265,13 @@ boolean writeMemberDocs(Model model, MemberShape member) {
docs = docs.replace("{", "\\{")
.replace("}", "\\}");
if (member.getTrait(DeprecatedTrait.class).isPresent() || isTargetDeprecated(model, member)) {
docs = docs + "\n\n@deprecated";
DeprecatedTrait deprecatedTrait = member.getTrait(DeprecatedTrait.class)
.or(() -> model.expectShape(member.getTarget()).getTrait(DeprecatedTrait.class))
.orElseThrow();
String deprecationMessage = deprecatedTrait.getMessage()
.orElse("deprecated");
String deprecationAnnotation = "@deprecated " + deprecationMessage;
docs = docs + "\n\n" + deprecationAnnotation;
}
docs = addReleaseTag(member, docs);
writeDocs(docs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,16 @@ operation GetNumbers {
@input
structure GetNumbersRequest {
bigDecimal: BigDecimal

bigInteger: BigInteger

@documentation("This is deprecated documentation annotation")
@deprecated
fieldWithoutMessage: String

@documentation("This is deprecated documentation annotation")
@deprecated(message: "This field has been deprecated", since: "3.0")
fieldWithMessage: String
}

@output
Expand Down