diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptWriter.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptWriter.java index b7cea6006c8..ba7ceda6191 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptWriter.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/TypeScriptWriter.java @@ -189,15 +189,15 @@ boolean writeShapeDocs(Shape shape, UnaryOperator preprocessor) { docs = docs.replace("{", "\\{") .replace("}", "\\}"); docs = preprocessor.apply(docs); + docs = addReleaseTag(shape, docs); 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 = deprecationString + "\n\n" + docs; + docs = docs + "\n" + deprecationString; } - docs = addReleaseTag(shape, docs); writeDocs(docs); return true; }).orElse(false); @@ -248,9 +248,9 @@ private boolean isTargetDeprecated(Model model, MemberShape member) { private String addReleaseTag(Shape shape, String docs) { if (shape.getTrait(InternalTrait.class).isPresent()) { - docs = "@internal\n" + docs; + docs = docs + "\n@internal"; } else { - docs = "@public\n" + docs; + docs = docs + "\n@public"; } return docs; }