Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add intEnum support, tests for enum generation #605

Merged
merged 1 commit into from
Oct 12, 2022

Conversation

srchase
Copy link
Contributor

@srchase srchase commented Sep 30, 2022

PR adds support for intEnum shapes added with Smithy IDLv2. It relies DirectedCodegen changes added in Smithy 1.26.0 and updates to use 1.26.x.

Given this Smithy model:

structure MyStruct {
    myIntEnum: MyIntEnum
}

intEnum MyIntEnum {
    BAR = 3
    FOO = 1
    BAZ = 2
}

The following types will be generated:

export enum MyIntEnum {
  FOO = 1,
  BAZ = 2,
  BAR = 3,
}

export interface MyStruct {
  myIntEnum?: MyIntEnum | number;
}

This PR also adds and updates tests and documentation for enum shape generation, including the | string behavior in the SymbolVisitor, and ordering applied to members in EnumGenerator.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@srchase srchase marked this pull request as ready for review October 12, 2022 21:11
@srchase srchase requested a review from a team as a code owner October 12, 2022 21:11
@trivikr trivikr merged commit b9ed0c5 into smithy-lang:main Oct 12, 2022
@jhecking
Copy link
Contributor

This was merged in October, but there hasn't been a release of the smithy-aws-typescript-codegen package since 0.12.0 in September. I would just like to understand what the intention & recommendation of the AWS Labs team is with regards to this package: At what point will a new official package be released? And should we rather build this package directly from the main branch ourselves rather than rely on the official package releases if we want to use it to generate our own Typescript client/server SDKs using Smithy?

srchase added a commit to srchase/smithy-typescript that referenced this pull request Mar 17, 2023
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.

5 participants