protoc-gen-jsonschema icon indicating copy to clipboard operation
protoc-gen-jsonschema copied to clipboard

Cannot convert proto

Open jack-burridge-cfh opened this issue 1 year ago • 3 comments

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

jack-burridge-cfh avatar Jul 01 '23 08:07 jack-burridge-cfh

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?

chrusty avatar Aug 06 '23 07:08 chrusty

@chrusty sadly it is not

jack-burridge-cfh avatar Aug 07 '23 17:08 jack-burridge-cfh

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

yngvesl avatar Dec 08 '23 10:12 yngvesl