Skip to content

Polymorphism in Response.schema #220

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

Closed
mission-liao opened this issue Nov 26, 2014 · 4 comments
Closed

Polymorphism in Response.schema #220

mission-liao opened this issue Nov 26, 2014 · 4 comments

Comments

@mission-liao
Copy link
Contributor

In this example, If I want to instantiate a 'Cat' Schema object, I would need to assign 'Cat' to 'petType' property to make others know it's a Cat object.

If I have a Responses object like this, when I need to convert the return value based on its Schema object, what value should I assign to 'petType'?

{
  default: {
    schema: {
      allOf:[
        { $ref: #/definitions/Pet }
        { properties: {...} }
      ]
    }
  }
}
@webron
Copy link
Member

webron commented Mar 4, 2015

IIRC, we discussed this in the mailing list (which is why you opened the issue here). Obviously the quick answer is to not define these things inline, but we may have to end up bringing back the id field.

@webron
Copy link
Member

webron commented Mar 27, 2016

Parent: #579.

@webron
Copy link
Member

webron commented Jul 21, 2016

Tackling PR: #741

@handrews
Copy link
Member

I'm pretty sure that this 5+ year old issue, if still relevant, would need to be updated to fit in with what's gone on since then in 3.0 and 3.1. So I'm going to close this. Please open a new issue with an updated description if it's still a concern for 3.1.

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

No branches or pull requests

3 participants