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

Adds changes to read full schema document #273

Merged
merged 2 commits into from
Jun 1, 2023

Conversation

popematt
Copy link
Contributor

@popematt popematt commented May 31, 2023

Issue #, if available:

#256

Description of changes:

  • Changes the signature of readSchema so that it returns a Pair<SchemaDocument, Iterator<IonValue>>—essentially, it returns the SchemaDocument and any unread IonValues.
  • Adds some utility functions for identifying top level content (header, footer, type, open content).
  • Adds implementation of readSchema with a lot of tests.
  • Fixes a bug with the reportError function that showed up while testing readSchema. Basically, fast-fail wasn't working properly because it was only throwing on fast fail without adding the error to the ReadContext.
  • Another incidental change is adding a useful toString() for Bag. I realized that the default impl was giving me things like Bag@398c0a, so I changed it to something useful.

Related PRs in ion-schema, ion-schema-tests, ion-schema-schemas:

None.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@popematt popematt requested a review from desaikd May 31, 2023 23:17
@codecov
Copy link

codecov bot commented May 31, 2023

Codecov Report

Patch coverage: 84.50% and project coverage change: +0.67 🎉

Comparison is base (63aba66) 83.59% compared to head (b5bbfa3) 84.27%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #273      +/-   ##
==========================================
+ Coverage   83.59%   84.27%   +0.67%     
==========================================
  Files         133      133              
  Lines        3262     3325      +63     
  Branches      768      788      +20     
==========================================
+ Hits         2727     2802      +75     
+ Misses        306      295      -11     
+ Partials      229      228       -1     
Impacted Files Coverage Δ
...azon/ionschema/internal/util/IonValueExtensions.kt 80.00% <0.00%> (-8.89%) ⬇️
...a/src/main/kotlin/com/amazon/ionschema/util/Bag.kt 75.00% <0.00%> (-10.72%) ⬇️
...otlin/com/amazon/ionschema/reader/internal/util.kt 81.81% <81.81%> (+18.18%) ⬆️
...com/amazon/ionschema/reader/IonSchemaReaderV2_0.kt 88.33% <87.03%> (+34.48%) ⬆️
...lin/com/amazon/ionschema/reader/IonSchemaReader.kt 100.00% <100.00%> (+66.66%) ⬆️
.../amazon/ionschema/reader/internal/ReaderContext.kt 92.30% <100.00%> (+0.64%) ⬆️
...amazon/ionschema/reader/internal/TypeReaderV2_0.kt 93.24% <100.00%> (+2.96%) ⬆️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@popematt popematt merged commit 6157830 into amazon-ion:master Jun 1, 2023
@popematt popematt deleted the read-schema branch June 1, 2023 19:13
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

Successfully merging this pull request may close these issues.

2 participants