Skip to content

Native aot type safe read#628

Merged
gregsdennis merged 1 commit into
native-aotfrom
native-aot-type-safe-read
Jan 28, 2024
Merged

Native aot type safe read#628
gregsdennis merged 1 commit into
native-aotfrom
native-aot-type-safe-read

Conversation

@gregsdennis

Copy link
Copy Markdown
Collaborator

Updated the options.Read<T>() extension to take a JsonTypeInfo<T> instead of the non-generic one.

This change infers the type parameter when a JTI is passed, which improves readability while also allowing us to explicitly use our serializer context. Additionally, it adds a compiler check to ensure that we're generating a JTI for every type that we explicitly deserialize.

@gregsdennis gregsdennis changed the base branch from master to native-aot January 28, 2024 00:09
@github-actions

Copy link
Copy Markdown

Test Results

    15 files  ± 0      15 suites  ±0   14s ⏱️ -3s
20 195 tests  - 15  18 837 ✅  - 16  1 358 💤 +1  0 ❌ ±0 
20 564 runs   - 22  19 158 ✅  - 23  1 406 💤 +1  0 ❌ ±0 

Results for commit 1146c73. ± Comparison against base commit 5f8949b.

This pull request removes 28 and adds 4 tests. Note that renamed tests count towards both.
    "other string"
    "string",
    42
  "foo": 42
  "foo": [
  42
  ]
Json.JsonE.Tests.TruthyTests ‑ IsTruthy([
Json.JsonE.Tests.TruthyTests ‑ IsTruthy({
Json.More.Tests.CopyTests ‑ ComplexCopy
…
Json.JsonE.Tests.TruthyTests ‑ IsTruthy([
  42
],True)
Json.JsonE.Tests.TruthyTests ‑ IsTruthy({
  "foo": 42
},True)
Json.Schema.Tests.CrossDraftTests ‑ ArrayItemsIsAllowedForDraft7({
  "foo": [
    "string",
    "other string"
  ]
},False)
Json.Schema.Tests.CrossDraftTests ‑ ArrayItemsIsAllowedForDraft7({
  "foo": [
    "string",
    42
  ]
},True)
This pull request skips 1 test.
Json.JsonE.Tests.DevTest ‑ Check

@gregsdennis gregsdennis mentioned this pull request Jan 28, 2024
@jevansaks

Copy link
Copy Markdown
Contributor

Cool! I like it.

@gregsdennis gregsdennis merged commit 1a6fd5a into native-aot Jan 28, 2024
@gregsdennis gregsdennis deleted the native-aot-type-safe-read branch January 28, 2024 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants