smithy-lang / smithy

Smithy is a protocol-agnostic interface definition language and set of tools for generating clients, servers, and documentation for any programming language.
https://smithy.io
Apache License 2.0
1.7k stars 201 forks source link

Update TraitCodegenWriter #2255

Closed hpmellema closed 2 months ago

hpmellema commented 2 months ago

Background

Updates the trait codegen writer to:

  1. Use a static factory class
  2. Add a CapitalizingFormatter formatter for $U
  3. Normalize symbol references before adding to duplicate map to avoid false positive duplicates (for example Map<String, String> and Map<String, Integer> would currently be marked as duplicates because their references differ, causing the Map class to use a fully qualified name unnecessarily)
  4. Put resolved placeholder values directly into context map rather than instantiating a second hashmap.

Testing


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.