Skip to content

Disallowed to serialize unknown enum members - #1334

Open
timocov wants to merge 1 commit into
smithy-lang:mainfrom
timocov:fix-unknown-enum
Open

Disallowed to serialize unknown enum members#1334
timocov wants to merge 1 commit into
smithy-lang:mainfrom
timocov:fix-unknown-enum

Conversation

@timocov

@timocov timocov commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What behavior changes?

Describe the observable difference in behavior before and after this change.

Similar to unions - we should be able to deserialize unknown values, but serializing doesn't feel correct?

Why is this change needed?

Explain the motivation: bug, feature request, refactor, performance, etc.

It does look like a bug - parsing unknown values makes sense for backward compatibility, but serialising means that unknown value is passed to the object. Unions handle it already and throw an exception when you serialize unknown variant.

How was this validated?

List tests added, benchmarks run, or manual verification performed.

Added tests.

What should reviewers focus on?

Point reviewers to the files or sections that contain the interesting logic.

Additional Links

Related issues, design docs, or prior art.


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

Similar to unions - we should be able to deserialize unknown values, but serializing should not be allowed
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.

1 participant