chrusty / protoc-gen-jsonschema

Protobuf to JSON-Schema compiler
Apache License 2.0
496 stars 101 forks source link

Cannot convert proto #158

Open jack-burridge-cfh opened 1 year ago

jack-burridge-cfh commented 1 year ago

I'm trying to convert this proto file but I get the error:

INFO[0000] Generating JSON-schema for MESSAGE            jsonschema_filename=StringAttribute.schema.json msg_name=StringAttribute proto_filename=collectionset.proto
INFO[0000] Generating JSON-schema for MESSAGE            jsonschema_filename=NumericAttribute.schema.json msg_name=NumericAttribute proto_filename=collectionset.proto
INFO[0000] Generating JSON-schema for MESSAGE            jsonschema_filename=NodeLevelResource.schema.json msg_name=NodeLevelResource proto_filename=collectionset.proto
ERRO[0000] Failed to convert                             error="no such message type named .NodeLevelResource" proto_filename=collectionset.proto
WARN[0000] Failed to process code generator but successfully sent the error to protoc 
--jsonschema_out: protoc-gen-jsonschema: Plugin failed with status code 1.
protoc --version
libprotoc 23.3
chrusty commented 1 year ago

Hi @jack-burridge-cfh, this is a strange one. I'm guessing it's related to that file not specifying a package name, which makes tracking messages difficult. Is that a file you control?

jack-burridge-cfh commented 1 year ago

@chrusty sadly it is not

yngvesl commented 12 months ago

I can confirm I got this error when I hadn't specified a package name. It worked when I specified one.