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 x-ms-enum as discriminator #387

Merged
merged 6 commits into from
Feb 7, 2019
Merged

Conversation

sergey-shandar
Copy link
Contributor

@sergey-shandar sergey-shandar commented Feb 6, 2019

Issue #325

ChangeLog.md Outdated Show resolved Hide resolved
Copy link

@vladbarosan vladbarosan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with a comment, please refer the issue on type change for jsonRefs

@sergey-shandar sergey-shandar merged commit 04411ac into master Feb 7, 2019
@sergey-shandar sergey-shandar deleted the sergey/one-of-multiple branch February 7, 2019 00:14
@veronicagg
Copy link
Contributor

@sergey-shandar could you expand on your resolution for my question/comment: "there are cases were this should be true, like on enums not part of discriminator types, how are we affecting those cases? we generally recommend modelAsString= true for specs, to avoid breaking changes in future api-versions for code generation, so I'd like to understand more of what's not working due to this value for the tool"

@sergey-shandar
Copy link
Contributor Author

sergey-shandar commented Feb 7, 2019

@veronicagg this fix is only applied for a specific model (internally generated) when we know exact value that we expect.

d.enum = [`${val}`]

Honestly, modelAsString in a discriminator may cause serious issues, because in this case we don't really know how to desterilize the structure if the value is not name of one of the polymorphic model. What's the fallback should be? Base class?

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.

3 participants