You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wing's json structs (structs that can be serialized into JSON) are designed to be able to express cloud data shapes. As such, they are closely related to JSON Schemas.
Currently, Wing's type system doesn't have the ability to express everything that JSON schemas can express.
For example, the oneOf and anyOf annotations can be used in JSON schemas to denote a union of possible types for a field, and this is currently not supported by the Wing type-system.
I expect to be able to model this in Winglang somehow.
Instead, this happened:
I don't have a way to model this.
Is there a workaround?
We can start by using Json to model these schemas without strong typing.
If that's suitable for my use case, I could just choose the first schema from the anyOf or oneOf arrays and use that, but this doesn't really address the underlying issue.
Component:
Language Design
Wing Version:
No response
Node.js Version:
No response
Platform(s):
No response
Anything else?
No response
Community Note
Please vote by adding a 👍 reaction to the issue to help us prioritize.
If you are interested to work on this issue, please leave a comment.
The text was updated successfully, but these errors were encountered:
This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days.
Feel free to re-open this issue when there's an update or relevant information to be added.
Thanks!
This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days.
Feel free to re-open this issue when there's an update or relevant information to be added.
Thanks!
This issue hasn't seen activity in 90 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days.
Feel free to re-open this issue when there's an update or relevant information to be added.
Thanks!
I tried this:
Wing's json structs (structs that can be serialized into JSON) are designed to be able to express cloud data shapes. As such, they are closely related to JSON Schemas.
Currently, Wing's type system doesn't have the ability to express everything that JSON schemas can express.
For example, the
oneOf
andanyOf
annotations can be used in JSON schemas to denote a union of possible types for a field, and this is currently not supported by the Wing type-system.Consider the following JSON schema:
I expected this:
I expect to be able to model this in Winglang somehow.
Instead, this happened:
I don't have a way to model this.
Is there a workaround?
We can start by using
Json
to model these schemas without strong typing.If that's suitable for my use case, I could just choose the first schema from the
anyOf
oroneOf
arrays and use that, but this doesn't really address the underlying issue.Component:
Language Design
Wing Version:
No response
Node.js Version:
No response
Platform(s):
No response
Anything else?
No response
Community Note
The text was updated successfully, but these errors were encountered: