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

@CompiledJson annotation does not bind byte[] to BinaryConverter in v2.0.0 #259

Closed
j-bahr opened this issue Jun 25, 2023 · 2 comments
Closed

Comments

@j-bahr
Copy link

j-bahr commented Jun 25, 2023

Previous version so DSL-JSON would correctly map byte[] to BinaryConverter. In the latest 2.0.0 release the annotation processor creates code that won't compile. It tries to create a JsonReader/Writer of type <byte>, not <byte[]> which fails to compile with the following error:

/.../dsl-json/examples/MavenJava/target/generated-sources/annotations/com/dslplatform/maven/_Example$Model_DslJsonConverter.java:163:66
java: unexpected type
  required: reference
  found:    byte

You can test this by adding public byte[] byteArray; to Model in the MavenJava -> Example.java file.

Previous versions of DSL json would create code of the following:

private com.dslplatform.json.JsonWriter.WriteObject<byte[]> writer_byteArray; 

2.0.0 produces the following:

private final com.dslplatform.json.JsonWriter.WriteObject<byte> writer_byteArray;

This can probably be worked around by assigning a converter for the type, but would prefer not to as this should work out of the box with the annotation processor.

@zapov
Copy link
Member

zapov commented Jun 25, 2023

Tnx for the bug report. Fixed in latest commit. Will try to release next week.

@zapov
Copy link
Member

zapov commented Jul 2, 2023

v2.0.1 released

@zapov zapov closed this as completed Jul 2, 2023
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

No branches or pull requests

2 participants