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

Consider returning values that were not consumed while reading a schema from an Ion stream #269

Open
popematt opened this issue May 26, 2023 · 0 comments

Comments

@popematt
Copy link
Contributor

popematt commented May 26, 2023

Should we look for another version marker and reenter the parsing loop if we find one?

No, I don't think so. There's a bunch of issues that make it undesirable to handle in the Ion Schema System right now. Basically, if we start parsing again, is the data part of the same schema, or is it a new schema? If it's part of the same schema, then we need to deal with the fact that we could have two different ISL versions contributing to the same schema (and this library is not in a state to handle that right now). If it's a different schema, then we have a situation where there are two schemas that came from one schema ID, and that's something that we don't want to allow.

I think the ideal long term solution would be to finish parsing one schema, and then return any remaining elements to the user. E.g., return a class SchemaReadOutput(val schema: SchemaDocument, val unconsumedValues: Iterable<IonValue>) or something like that—basically, we allow the user to decide whether to continue looking for more schemas in the Ion stream.

Originally posted by @popematt in #268 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant