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

fix serial/deserialization of presentation definitions #90

Merged
merged 4 commits into from
Oct 20, 2023

Conversation

phoebe-lew
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Merging #90 (c03481d) into main (6a81470) will increase coverage by 4.82%.
The diff coverage is 33.33%.

@@            Coverage Diff             @@
##             main      #90      +/-   ##
==========================================
+ Coverage   56.73%   61.55%   +4.82%     
==========================================
  Files          20       20              
  Lines         832      822      -10     
  Branches       99      100       +1     
==========================================
+ Hits          472      506      +34     
+ Misses        313      269      -44     
  Partials       47       47              
Components Coverage Δ
credentials 64.63% <33.33%> (+23.25%) ⬆️
crypto 33.57% <ø> (ø)
dids 88.38% <ø> (ø)
common 60.83% <ø> (ø)

@phoebe-lew phoebe-lew changed the title serialize/deserialize presentation definitions according to spec casing fix serial/deserialization of presentation definitions Oct 20, 2023

@Test
fun `can deserialize`() {
val pdString = """
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would recommend splitting the json into a separate file.

.setSerializationInclusion(JsonInclude.Include.NON_NULL)

@Test
fun `can serialize`() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One additional test that I find very useful is around idempotency. See https://github.com/TBD54566975/web5-kt/blob/a8d10d9fa92226d2432dbb8fd85f9a46792bf5be/dids/src/test/kotlin/web5/sdk/dids/DidResolutionResultTest.kt#L13 for an example. It makes sure that data isn't lost in the round trip.

@phoebe-lew phoebe-lew merged commit 75c485d into main Oct 20, 2023
@phoebe-lew phoebe-lew deleted the plew.fix-pd-serialization branch October 20, 2023 23:35
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.

3 participants