-
Notifications
You must be signed in to change notification settings - Fork 65
Add support for Edm.Untyped #531
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
Conversation
@@ -30590,6 +30590,11 @@ | |||
"type": "string" | |||
} | |||
}, | |||
"TripData": {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave it an empty object? or use a 'type': 'object'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"TripData": {}, | |
"TripData": { | |
"type": "object" | |
} |
@andrueastman Your thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should leave it as empty. The reason being that the data could be a primitive as well(integer, string ...) or even a collection. As the type is only known at runtime so I think it would be incorrect to allude that it's an object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we could have something like this (the list of types is not exhaustive):
components:
schemas:
ExampleResource:
type: object
properties:
id:
type: string
customData:
anyOf:
- type: string
- type: number
- type: integer
- type: boolean
- type: object
- type: array
items:
anyOf:
- type: string
- type: number
- type: integer
- type: boolean
- type: object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its not practical to model out everything it could be, as it could be a collection of structs each with a heterogeneous collection that's a mixture of bools, ints and more structs. So, as @andrueastman says, it's completely unknown at design time.
My JSON schema skill isn't strong, but appears that {}
best expresses that complete lack of knowledge whether it is primitive, object or array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @garethj-msft
9442bc9
to
d3660a5
Compare
d3660a5
to
72da466
Compare
299ef2a
to
181ced0
Compare
|
Fixes #511