Skip to content

JSON Object is not generated correctly for nested proto message #176

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

Closed
yiplee opened this issue Jun 22, 2022 · 1 comment · Fixed by #178
Closed

JSON Object is not generated correctly for nested proto message #176

yiplee opened this issue Jun 22, 2022 · 1 comment · Fixed by #178

Comments

@yiplee
Copy link

yiplee commented Jun 22, 2022

haberdasher.proto

syntax = "proto3";

// Haberdasher service makes hats for clients.
service Haberdasher {
  // MakeHat produces a hat of mysterious, randomly-selected color!
  rpc MakeHat(Req.MakeHat) returns (Hat);
}

// Size of a Hat, in inches.
message Req {
    message MakeHat {
        int32 inches = 1; // must be > 0
    }
}

// A Hat is a piece of headwear made by a Haberdasher.
message Hat {
  int32 inches = 1;
  string color = 2; // anything but "invisible"
  string name = 3; // i.e. "bowler"
}

haberdasher.pb.js

/**
 * MakeHat produces a hat of mysterious, randomly-selected color!
 */
export async function MakeHatJSON(makeHat, config) {
  const response = await JSONrequest(
    "/Haberdasher/MakeHat",
    Req.MakeHatJSON.encode(makeHat),
    config
  );
  return HatJSON.decode(response);
}

Req.MakeHatJSON is missing from the generated file.

@tatethurston
Copy link
Owner

Hey @yiplee, thanks for reporting this. I've fixed the issue in #178 and published v0.0.59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants