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
And the example in the Core Types section of the spec says:
The core types do not include any of Ion's null.* values, but each of the types may have a weakly- or strongly-typed null value if the type name is annotated with nullable. When a strongly-typed null value is encountered, its type must agree with one of the core types of the expected type. For example, if a any_of: nullable::[int, string, struct] is expected, 5, "hi", {}, null, null.null, null.int, null.string, and null.struct are all valid values, but null.decimal is not.
Even ignoring the fact that the example does not match the grammar (nullable:: should be on a type reference, not a list of type references), the ion-schema-kotlin implementation does not do what this says. I also tried several other type definitions that are similar to the example, and the Ion Schema System consistently failed to allow the null values or ran into a StackOverflowError, unless I specifically used an ion type instead of a core type.
Given the test cases mentioned in the quoted paragraph, here are the results for the type in the example, and several similar types.
The Ion Schema Grammar allows for
nullable::
to be applied to any type reference.And the example in the Core Types section of the spec says:
Even ignoring the fact that the example does not match the grammar (
nullable::
should be on a type reference, not a list of type references), the ion-schema-kotlin implementation does not do what this says. I also tried several other type definitions that are similar to the example, and the Ion Schema System consistently failed to allow the null values or ran into a StackOverflowError, unless I specifically used an ion type instead of a core type.Given the test cases mentioned in the quoted paragraph, here are the results for the type in the example, and several similar types.
type::{any_of:nullable::[int, string, struct]}
null
,null.null
,null.struct
,null.int
,null.string
type::{type:nullable::{any_of:[int, string, struct]}}
null.decimal
,null.struct
,null.int
,null.string
type::{any_of:[nullable::int, nullable::string, nullable::struct]}
null
,null.null
,null.struct
,null.int
,null.string
type::{type:nullable::any, any_of:[nullable::int, nullable::string, nullable::struct]}
null.decimal
,null.struct
,null.int
,null.string
type::{type:nullable::any}
null.decimal
,null.struct
,null.int
,null.string
type::{type:$any, any_of:[nullable::int, nullable::string, nullable::struct]}
The text was updated successfully, but these errors were encountered: