Kreya icon indicating copy to clipboard operation
Kreya copied to clipboard

Error trying to import protos from google/fhir

Open andremoah opened this issue 3 years ago • 2 comments

Describe the bug Trying to import a protobuf that uses https://github.com/google/fhir/tree/master/proto/google/fhir/proto throws an error making us unable to use Kreya in our company.

I was unable to dig into the problem as the error is not too descriptive but I think it might be related to some files being over 8k lines.

To Reproduce

  1. Go to Importers
  2. Add a new importer for gRPC proto files
  3. Add import map to .../@cockpit-grpc
  4. import folder .../@cockpit-grpc/individuals-microservice
  5. Click Save

Expected behavior Import should work as usual.

Screenshots image

Environment (if possible, copy the information from the error dialog or the About menu):

  • OS: MacIntel (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_16) AppleWebKit/605.1.15 (KHTML, like Gecko))
  • Kreya Version 1.5.0

In attachment there is the required protos to test.

@cockpit-grpc.zip

If you need more information please let me know as we would love to migrate from BloomRPC to Kreya.

andremoah avatar Aug 28 '21 18:08 andremoah

This is a bug in one of our dependencies, see https://github.com/protobuf-net/protobuf-net/issues/833. We have to wait until that bug is resolved.

As a workaround, you could modify proto/r4/core/datatypes.proto by either removing all option (...) lines or by replacing all \\ occurrences with empty strings. This way, Kreya would be able to import the proto files, since it doesn't need (or use) the custom options. But careful if you use the same modified proto files with other tools, since they may need those custom options.

CommonGuy avatar Aug 30 '21 14:08 CommonGuy

Another workaround would be to use the new filedescriptor set importer

CommonGuy avatar Sep 17 '21 13:09 CommonGuy

We just released Kreya 1.9, which contains a fix for this bug.

CommonGuy avatar Nov 04 '22 16:11 CommonGuy