Skip to content

[Avro] Unit test for untyped map schema fails in 2.13 branch #281

Closed
@MichalFoksa

Description

@MichalFoksa

Unit test TestSimpleGeneration#testSchemaForUntypedMap fails in 2.13 branch.

UnsupportedOperationException exception is thrown instead of expected InvalidDefinitionException exception.

[ERROR] Errors:
[ERROR]   TestSimpleGeneration.testSchemaForUntypedMap:166 » UnsupportedOperation Maps w...

Stack trace:

java.lang.UnsupportedOperationException: Maps with non-stringable keys are not supported yet

	at com.fasterxml.jackson.dataformat.avro.schema.MapVisitor.builtAvroSchema(MapVisitor.java:40)
	at com.fasterxml.jackson.dataformat.avro.schema.VisitorFormatWrapperImpl.getAvroSchema(VisitorFormatWrapperImpl.java:68)
	at com.fasterxml.jackson.dataformat.avro.schema.AvroSchemaGenerator.getGeneratedSchema(AvroSchemaGenerator.java:20)
	at com.fasterxml.jackson.dataformat.avro.AvroMapper.schemaFor(AvroMapper.java:187)
	at com.fasterxml.jackson.dataformat.avro.schema.TestSimpleGeneration.testSchemaForUntypedMap(TestSimpleGeneration.java:166)

In 2.13 UnknownSerializer calls visitor.expectObjectFormat(typeHint) whereas in 2.12, UnknownSerializer calls visitor.expectAnyFormat(typeHint).

It is since FasterXML/jackson-databind@f19e26e

I think the whole fix is to update exception evaluation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions