Skip to content

Update intEnum generation to use type alias#398

Merged
syall merged 1 commit intoaws:mainfrom
syall:int-enum-type-alias
Nov 16, 2022
Merged

Update intEnum generation to use type alias#398
syall merged 1 commit intoaws:mainfrom
syall:int-enum-type-alias

Conversation

@syall
Copy link
Copy Markdown
Contributor

@syall syall commented Nov 11, 2022

Issue #, if available:

N/A


Description of changes:

Due to type definitions requiring strict casting and implementation
overhead in protocol generation, this commit uses type aliases to
generate intEnums as an intermediate step until migrating back to
type definitions.

This change is backwards compatible except for the removed Values()
method that was on intEnum type definitions, but not definable on type
aliases since defining methods on base types (int32) is not permitted.

Note: No AWS services use the intEnum shape YET, so for aws-sdk-go-v2, it is backwards compatible.


Testing:

Temporarily change all repo smithy versions to 1.28.0 (not published at the time of the PR).

  1. smithy: ./gradlew clean build check publishToMavenLocal using this PR: Update protocol tests with int enum coverage smithy-lang/smithy#1492
  2. smithy-go: make smithy-clean smithy-build smithy-publish-local smithy-clean
  3. aws-sdk-go-v2: make
    • Temporarily change Makefile -fail-fast=false
    • Protocol Tests related to intEnums pass

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

Due to type definitions requiring strict casting and implementation
overhead in protocol generation, this commit uses type aliases to
generate intEnums as an intermediate step until migrating back to
type definitions.

This change is backwards compatible except for the removed `Values()`
method that was on intEnum type definitions, but not definable on type
aliases since defining methods on base types (`int32`) is not permitted.
@syall syall requested a review from a team as a code owner November 11, 2022 20:10
@syall syall merged commit a41ec93 into aws:main Nov 16, 2022
@syall syall deleted the int-enum-type-alias branch November 16, 2022 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants