Skip to content
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

Cyclical "is-a" relationships between types causes StackOverflowException #301

Open
popematt opened this issue Jan 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@popematt
Copy link
Contributor

popematt commented Jan 9, 2024

When any number of types have a circular "is-a" relationship it results in a StackOverflowException during validation. Ideally, it should result in an InvalidSchemaException when loading the schema. See amazon-ion/ion-schema-rust#205 for more details.

Minimal reproducible example:

@Test
fun `types with cyclical is-a relationships should cause InvalidSchemaException`() {
    val iss = IonSchemaSystemBuilder.standard().build()
    val isl = """
        type::{ name: a, type: b }
        type::{ name: b, type: a }
    """
    assertThrows<InvalidSchemaException> { iss.newSchema(isl) }
}
@popematt popematt added the bug Something isn't working label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant