[
https://issues.apache.org/jira/browse/AVRO-3677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18105492#comment-18105492
]
ASF subversion and git services commented on AVRO-3677:
-------------------------------------------------------
Commit 326950f40c1172f7564c757b0e51c39883721083 in avro's branch
refs/heads/main from Ismaël Mejía
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=326950f40c ]
AVRO-4332: [java] Enable and fix the dormant IdlUtils tests
The IdlUtils test class was never executed: Surefire only includes
classes matching **/Test** (name starting with "Test"), but the class
was named IdlUtilsTest, so its tests silently rotted since AVRO-3677.
Rename IdlUtilsTest to TestIdlUtils so the suite runs, and fix the
problems this uncovers:
- byte[] values serialized to an empty string because the byte[]
serializer discarded MAPPER.writeValueAsString(...) instead of
writing to the generator; write the value to the generator.
- The callToJson test helper had the same discard bug, so every
*ToJson assertion previously compared against an empty string.
- The happy-flow fixtures lived under org/apache/avro/util and were
unreachable from the org.apache.avro.idl package; move them beside
the test and regenerate them from the current writer output.
- getMainSchema() now returns the record directly, so drop the
obsolete union unwrapping in validateHappyFlowForSingleSchema.
- Map/collection JSON expectations now include the ", " separator the
MAPPER emits.
> Introduce Named Schema Formatters
> ---------------------------------
>
> Key: AVRO-3677
> URL: https://issues.apache.org/jira/browse/AVRO-3677
> Project: Apache Avro
> Issue Type: New Feature
> Components: java
> Affects Versions: 1.11.1
> Reporter: Oscar Westra van Holthe - Kind
> Assignee: Oscar Westra van Holthe - Kind
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.12.0
>
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> Similar to AVRO-3666, which introduces multiple schema parsers, I propose to
> introduce multiple, named, schema formatters.
> Names can be of the form {{{}<name>[/<variant>]{}}}, there the variant part
> is optional.
> Initially, the list would be:
> * json -> alias for json/pretty
> * json/pretty -> pretty{-}-{-}printed JSON; replaces
> {{{}Schema.toString(true){}}}
> * json/inline -> single-line JSON; replaces {{{}Schema.toString(false){}}}
> * canonical -> Parsing Canonical Form (as per spec)
> Then, after merging AVRO-3404, we can also add:
> * idl -> to write schemata in IDL format, as requested in AVRO-1757
--
This message was sent by Atlassian Jira
(v8.20.10#820010)