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

Adding custom polymorphic discriminator support #474

Merged
merged 3 commits into from
Nov 10, 2015

Conversation

brjohnstmsft
Copy link
Member

This change adds a new extension, x-ms-discriminator-value, that lets you model type hierarchies where the serialized name used to identify a sub-type can differ from the sub-type's name. The value flows through to the CompositeType.SerializedName property. The generated code for C#, Node.js, and Java can already handle having a SerializedName differ from Name, but it took more work to support it in Ruby.

Related issue: #366

Added an extension that lets you specify the discriminator value for a derived
type, plus test coverage.
Custom discriminators already worked as-is for C#, Node.js, and Java. Ruby
required more work to get right. The approach I took is modeled loosely off
the one used in the generated Node.js code.
stankovski added a commit that referenced this pull request Nov 10, 2015
Adding custom polymorphic discriminator support
@stankovski stankovski merged commit 4eb52d0 into Azure:dev Nov 10, 2015
@brjohnstmsft brjohnstmsft deleted the polyfixrb branch November 10, 2015 23: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.

3 participants