Skip to content

Commit

Permalink
chore(codegen): include default value comment for service id
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardomourar committed Nov 7, 2022
1 parent 962458d commit 5c72a86
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ public void addConfigInterfaceFields(
TypeScriptWriter writer
) {
if (isAwsService(settings, model)) {
writer.writeDocs("Unique service identifier.\n@internal")
ServiceShape service = settings.getService(model);
String sdkId = service.getTrait(ServiceTrait.class).map(ServiceTrait::getSdkId)
.orElse("");
writer.writeDocs(String.format("Unique service identifier.%n@internal%n@default \"%s\"", sdkId))
.write("serviceId?: string;\n");
}
if (isSigV4Service(settings, model)) {
Expand Down Expand Up @@ -106,7 +109,7 @@ public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(
writer.write("$S", serviceId);
});
} else {
LOGGER.info("Cannot generate a serivce ID for the client because no aws.api#Service "
LOGGER.info("Cannot generate a service ID for the client because no aws.api#Service "
+ "trait was found on " + service.getId());
}
}
Expand Down

0 comments on commit 5c72a86

Please sign in to comment.