-
-
Notifications
You must be signed in to change notification settings - Fork 598
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
Object composition of primitive types rebilly.com #98
Comments
@sergey-tihon Yes, it corrects it's only possible way to override createTime:
allOf:
- $ref: '#/definitions/ServerTimestamp'
- description: The API key created time But in this case, it's less obvious what takes priority. |
But in the json schema it is written like createTime:
allOf:
- $ref: '#/definitions/ServerTimestamp'
description: The API key created time |
Am I right that is not possible to write createTime:
$ref: '#/definitions/ServerTimestamp'
description: The API key created time and we have to use createTime:
allOf:
- $ref: '#/definitions/ServerTimestamp'
description: The API key created time |
Disclaimer: I helped Rebilly to create their spec and suggest them to use this pattern. Both forms are valid according to JSON Schema and Swagger. |
@sergey-tihon Yes exactly.
https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03 But it's very common mistake to think that P.S. But we need something more appropriate like |
My confusion was about members of But in this case you uses primitive type in |
It's a tricky part since JSON Schema not merging-friendly, it was never intended to be used for something other than JSON validation :(
It could be anything not only metadata. |
Schema https://api.apis.guru/v2/specs/rebilly.com/2.1/swagger.json has very strange use of
allOf
object compositionwhere
ServerTimestamp
is:Is it correct use of
allOf
?The text was updated successfully, but these errors were encountered: