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

fix(generation): Don't require all Lists on input structures #21

Merged
merged 2 commits into from
Dec 26, 2021

Conversation

danopia
Copy link
Member

@danopia danopia commented Dec 26, 2021

This was originally intended as a convenience feature around output types, because our XML parser will always supply a value for lists and maps, even if it's empty. But sometimes the same interface is used as both an Input and Output, and requiring all lists for Inputs is effectively a bug.

The fix is to disable our output structure upgrade logic on any interface that is also used as an input in the specific API being generated. So you just need to do a null check when reading lists off those specific outputs, something the official SDK makes you do all the time.

Fixes #16

When using an action filter it's less likely that this kill-switch will kick in, but with whole modules it's actually pretty common.

backwards compat

codegens v0.1 and v0.2 are retaining old behavior as otherwise this would introduce typecheck errors in existing user code.

This was originally intended as a convenience feature around output
types, because our XML parser will always supply a value for lists and
maps, even if it's empty. But sometimes the same interface is used as
both an Input and Output, and requiring all lists for Inputs is
effectively a bug.

The fix is to disable our output structure upgrade logic on
any interface that is *also* used as an input in the specific API being
generated.

When using an action filter it's less likely that this kill-switch
will kick in, but with whole modules it's actually pretty common.

codegens v0.1 and v0.2 are retaining old behavior as otherwise this
would introduce typecheck errors in existing client code.
@danopia danopia merged commit 3817d08 into main Dec 26, 2021
@danopia danopia deleted the fix-required-lists branch December 26, 2021 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Can't run new EC2 instance with providing NetworkInterfaces
1 participant