-
-
Notifications
You must be signed in to change notification settings - Fork 232
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
Expand schemas #1
Comments
@BigstickCarpet - is this a feature you'd be willing to include, or should I hack something in and submit a PR? It seems like expanding an |
Ok, I finally got a chance to look into this today. Thank you for submitting the PR and writing some tests. That really helped me get a better understanding of the proposed behavior. After reviewing the relevant specs (Swagger 2.0 and JSON Schema draft v4), I don't think it would be a good idea to implement this feature. The The good news is that there are proposals to add true inheritance to JSON Schema draft v5. Possible solutions include the |
The intention of this PR was to support composition. Inheritance and polymorphism are not a goal, and are not implemented in any of the code. It looks like the main contributors of Swagger agree with you about the technical implications of
Source: swagger-api/swagger-js#188 (comment) The swagger team has laid out a section on composition and inheritance polymorphism that goes above and beyond JSON Schema. While composition and inheritance and laid out as two separate things in the spec, only composition seems to be well supported -- polymorphism is in progress: swagger-api/swagger-js#567 |
Thanks for linking to that conversation. I wasn't aware that the Swagger team already had pretty much this same conversation. Ultimately, I agree with @webron's stance that...
I think you and I are both in agreement then, that merging multiple schemas into a single schema based on the |
Original spec from here: jdorn/json-editor#49
Should produce the following after it's expanded:
Moved from APIDevTools/swagger-parser#15
The text was updated successfully, but these errors were encountered: