-
Notifications
You must be signed in to change notification settings - Fork 0
require custom jsoniter json type to be provided #24
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR requires users to provide a custom JSON type reference when using the Jsoniter codec, addressing a limitation where Jsoniter doesn't provide a built-in type for raw JSON values. The change makes the JSON type configuration explicit and mandatory for Jsoniter users.
- Modified the
JsonCodec.Jsoniterenum case to require ajsonTypeRefparameter - Added CLI validation to enforce the
-jsoniter-json-typeparameter when using Jsoniter - Removed auto-generated codec logic in favor of requiring user-provided custom JSON types
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
modules/core/shared/src/main/scala/codegen.scala |
Modified JsonCodec.Jsoniter to accept a jsonTypeRef parameter, removed common codec generation logic, and updated code generation to use the custom JSON type reference |
modules/cli/src/main/scala/cli.scala |
Updated argument parsing to require -jsoniter-json-type when using Jsoniter codec, modified argument processing to preserve case sensitivity for values |
modules/example-jsoniter-json/shared/src/main/scala/json.scala |
Added example implementation of a custom Jsoniter JSON type using an opaque type wrapper around Array[Byte] |
build.sbt |
Added new exampleJsoniterJson project, updated jsoniter-scala version to 2.38.8, and configured test projects to depend on the example JSON implementation when using Jsoniter |
README.md |
Updated documentation with example of custom Jsoniter JSON type, added new -jsoniter-json-type configuration parameter, and updated dependency versions |
test_gen.sh |
Added -jsoniter-json-type parameter to test generation script and changed array type to ziochunk |
example/generate.scala |
Updated Scala version to 3.7.4, updated codegen dependency version to 0.0.12, and switched JSON codec from Jsoniter to ZioJson |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.