Skip to content

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

@popematt

Description

@popematt

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions