Skip to content

Commit d61c086

Browse files
authored
Minor improvement wrt #483: not a fix but better error message (#513)
1 parent bbe1e5c commit d61c086

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

protobuf/src/main/java/com/fasterxml/jackson/dataformat/protobuf/schemagen/ProtoBufSchemaVisitor.java

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -80,34 +80,35 @@ public Set<TypeElement> buildWithDependencies() {
8080
/*********************************************************************
8181
*/
8282

83-
@Override
84-
public JsonObjectFormatVisitor expectObjectFormat(JavaType type) {
85-
MessageElementVisitor visitor = new MessageElementVisitor(_provider, type, _definedTypeElementBuilders,
86-
_isNested);
87-
_builder = visitor;
88-
_definedTypeElementBuilders.addTypeElement(type, visitor, _isNested);
89-
return visitor;
90-
}
83+
@Override
84+
public JsonObjectFormatVisitor expectObjectFormat(JavaType type) {
85+
MessageElementVisitor visitor = new MessageElementVisitor(_provider, type, _definedTypeElementBuilders,
86+
_isNested);
87+
_builder = visitor;
88+
_definedTypeElementBuilders.addTypeElement(type, visitor, _isNested);
89+
return visitor;
90+
}
9191

92-
@Override
93-
public JsonMapFormatVisitor expectMapFormat(JavaType mapType) {
94-
// 31-Mar-2017, tatu: I don't think protobuf v2 really supports map types natively,
95-
// and we can't quite assume anything specific can we?
96-
return _throwUnsupported("'Map' type not supported as type by protobuf module");
97-
}
92+
@Override
93+
public JsonMapFormatVisitor expectMapFormat(JavaType mapType) {
94+
// 31-Mar-2017, tatu: I don't think protobuf v2 really supports map types natively,
95+
// and we can't quite assume anything specific can we?
96+
return _throwUnsupported("'Map' type not supported as type by protobuf module");
97+
}
9898

99-
@Override
100-
public JsonArrayFormatVisitor expectArrayFormat(JavaType type) {
101-
// 31-Mar-2017, tatu: This is bit messy, may get Base64 encoded or int array so
102-
if (ProtobufSchemaHelper.isBinaryType(type)) {
103-
_simpleType = ScalarType.BYTES;
104-
return null;
105-
}
99+
@Override
100+
public JsonArrayFormatVisitor expectArrayFormat(JavaType type) {
101+
// 31-Mar-2017, tatu: This is bit messy, may get Base64 encoded or int array so
102+
if (ProtobufSchemaHelper.isBinaryType(type)) {
103+
_simpleType = ScalarType.BYTES;
104+
return null;
105+
}
106106

107-
// !!! TODO: surely we should support array types, right?
107+
// !!! TODO: surely we should support array types, right?
108+
// 21-Aug-2024, tatu: [dataformats-binary#483] caused by this
108109

109-
return _throwUnsupported("'Map' type not supported as type by protobuf module");
110-
}
110+
return _throwUnsupported("'Array' type not supported as type by protobuf module");
111+
}
111112

112113
/*
113114
/*********************************************************************

0 commit comments

Comments
 (0)