-
Notifications
You must be signed in to change notification settings - Fork 154
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
Improved Enum support #154
Labels
Comments
In addition, we should also adjust generation for Enum Sets so:
|
Maybe that idea can be applied to all sub-types (i.e: not only Enum)?
I'd say this is already de behavior, isn't it? |
Yes that's a good point. Lets open another issue to track that. It should
be easier to do once we've made the changes to the mapper to handle
pointers for enum type objects.
…On Tue, 13 Jul 2021, 07:51 Adrián Moreno, ***@***.***> wrote:
* In cases where `min = 0 && max = 1` we should use a pointer to an Enum Type
Maybe that idea can be applied to every type (i.e: not only Enum)?
Lots of other columns also use this "pattern". e.g:
"Logical_Router": {
"columns": {
"enabled": {
"type": {
"key": "boolean",
"min": 0
}
},
...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#154 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA43JEKOPATASWONVQBN3KTTXPO65ANCNFSM46OTZVNQ>
.
|
dave-tucker
added a commit
to dave-tucker/libovsdb
that referenced
this issue
Jul 14, 2021
This commit: 1. Adjusts the mapper to handle stronger enum types 2. Adjusts modelgen to produce these types Fixes: ovn-org#154 Signed-off-by: Dave Tucker <[email protected]>
dave-tucker
added a commit
to dave-tucker/libovsdb
that referenced
this issue
Jul 15, 2021
This commit: 1. Adjusts the mapper to handle stronger enum types 2. Adjusts modelgen to produce these types Fixes: ovn-org#154 Signed-off-by: Dave Tucker <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently strong enum typing is not supported. #147 added type alias (e.g:
type Alias = string
) but, as discussed in that PR, that does not really enforce strong typing limitations.For that to work we would need to to modify the
ovsdb.bindings
andmapper
layers to cope with named-types.Once core functionality is added, apart from nice enum validation, we can change replace the type alias with named-types in the generator and should be transparent to clients
The text was updated successfully, but these errors were encountered: