smithy-lang / smithy-kotlin

Smithy code generator for Kotlin (in development)
Apache License 2.0
79 stars 26 forks source link

refactor: migrate non AWS specific protocol generation #1012

Closed aajtodd closed 9 months ago

aajtodd commented 9 months ago

Issue \

n/a

Description of changes

This PR has a lot of codegen refactoring to support eventual migration of AWS protocol support from aws-sdk-kotlin to a new module in smithy-kotlin. The changes mostly involve declaring new sections that can be overridden and/or migrating logic that probably should have never been in aws-sdk-kotlin in the first place (e.g. sigv4 related stuff should have lived with the sigv4 integration).

Summary below:

refactor: remove unused KotlinIntegration::onShapeWriterUse extension function refactor: Replace KotlinIntegration::renderBindEndpointBuiltins with a new function customizeEndpointResolution which allows for more than just overriding rendering support for builtins. It allows registering custom property renderers and custom function support. refactor: Remove exception base class from ProtocolGenerator in favor of declaring a section that can be overwritten. The logic for rendering the exception has been abstracted to ServiceExceptionBaseClassGenerator so that it can mostly be re-used when doing so. refactor: Migrate mergeSequential from aws-sdk-kotlin runtime to smithy-kotlin runtime. There wasn't anything AWS specific about this and it is only used for event streams (currently) refactor: Sigv4 integration

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

sonarcloud[bot] commented 9 months ago

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

3 New issues
0 Security Hotspots
No data about Coverage
2.1% Duplication on New Code

See analysis details on SonarCloud