Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Domain objects are not created properly from proto file #9

Open
0x-shanks opened this issue Jul 13, 2021 · 5 comments
Open

Domain objects are not created properly from proto file #9

0x-shanks opened this issue Jul 13, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@0x-shanks
Copy link
Collaborator

Describe the bug
Running roche scaffold domain NAME after editing a Proto file creates a domain object with fields that are not the edited ones.

for example
user.proto

message User {
  string id = 1;
  string name = 2;
}

but

domain/entity/user.go

type User struct {
	UserId string
	XXX_NoUnkeyedLiteral
	XXX_unrecognized
	XXX_sizecache int32
}

Expected behavior
domain/entity/user.go

type User struct {
	Id string
	name string
}
@0x-shanks 0x-shanks added the bug Something isn't working label Jul 13, 2021
@riita10069
Copy link
Owner

Thanks for the report.
I can't reproduce that on my local Mac Book.

Did you run protoc after updating the .proto?
roche is internally looking at the pb.go structure.
Or are you not using the latest version of roche?

@0x-shanks
Copy link
Collaborator Author

I'm sorry, I didn't run the roche protoc command, I forgot it wasn't in the readme!

@0x-shanks
Copy link
Collaborator Author

I just don't get an error message when I run the roche protoc, so I'll have to make that an issue.

@riita10069
Copy link
Owner

The current roche protoc has the following problems.
izumin5210/grapi#130
Therefore, it is not described in the readme.

Strictly speaking, tools.go has the potential ability to solve the problem.

@0x-shanks
Copy link
Collaborator Author

0x-shanks commented Jul 14, 2021

I think we've talked about this issue before.

In my environment, when I used grapi v0.5.0, I got an error, but the grapi that roche depends on is a later version, right?

Example of error output of grapi v0.5.0

  ➜  Execute protoc
  ▸  Install plugins
  ▸  Execute protoc
     ✗  api/protos/user.proto
        failed to execute command: [protoc -I api/protos -I ./api/protos -I /workspace/github.com/grpc-ecosystem/[email protected] -I /workspace/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/third_party/googleapis --grpc-gateway_out=logtostderr=true,paths=source_relative:api api/protos/user.proto]
        --grpc-gateway_out: no field "id" found in UpdateUserRequest
        : exit status 1

roche protoc

  ➜  Execute protoc
  ▸  Install plugins
  ▸  Execute protoc
     ✔  api/protos/user.proto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants