File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 33
33
import software .amazon .smithy .model .Model ;
34
34
import software .amazon .smithy .model .shapes .MemberShape ;
35
35
import software .amazon .smithy .model .shapes .Shape ;
36
+ import software .amazon .smithy .model .traits .DeprecatedTrait ;
36
37
import software .amazon .smithy .model .traits .DocumentationTrait ;
37
38
import software .amazon .smithy .utils .CodeWriter ;
38
39
import software .amazon .smithy .utils .StringUtils ;
@@ -216,6 +217,9 @@ boolean writeShapeDocs(Shape shape) {
216
217
return shape .getTrait (DocumentationTrait .class )
217
218
.map (DocumentationTrait ::getValue )
218
219
.map (docs -> {
220
+ if (shape .getTrait (DeprecatedTrait .class ).isPresent ()) {
221
+ docs = "@deprecated\n \n " + docs ;
222
+ }
219
223
writeDocs (docs );
220
224
return true ;
221
225
}).orElse (false );
@@ -232,6 +236,9 @@ boolean writeMemberDocs(Model model, MemberShape member) {
232
236
return member .getMemberTrait (model , DocumentationTrait .class )
233
237
.map (DocumentationTrait ::getValue )
234
238
.map (docs -> {
239
+ if (member .getMemberTrait (model , DeprecatedTrait .class ).isPresent ()) {
240
+ docs = "@deprecated\n \n " + docs ;
241
+ }
235
242
writeDocs (docs );
236
243
return true ;
237
244
}).orElse (false );
You can’t perform that action at this time.
0 commit comments