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

JSON schema oneOf support for swagger #45

Merged
merged 1 commit into from
Nov 18, 2015

Conversation

Verlic
Copy link
Contributor

@Verlic Verlic commented Nov 13, 2015

Brief

Adds support to detect the oneOf property and replace the value with the first defined schema in the array. This prevents swagger from breaking as they don't support oneOf.

E.g.:

response: {
    schema: {
         oneOf: [
              { type: 'object', properties: { ... } },
              { type: 'array', items: { ... } }
         ]
   }
}

Will replace the node oneOf with the first defined schema, i.e. with { type: 'object', properties: { ... } }. This way Swagger continues to work showing the documentation for the first schema in the array.

Note: It does not support definitions. It'll only work for inline schemas as the example above.

…(swagger does not support 'oneOf'). it takes the first available schema as the default one and replaces the node with that one
mac- added a commit that referenced this pull request Nov 18, 2015
JSON schema oneOf support for swagger
@mac- mac- merged commit 0118514 into mac-:master Nov 18, 2015
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.

2 participants