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

Cannot generate stub from .proto #1

Open
n04ln opened this issue Jan 11, 2019 · 0 comments · May be fixed by #2
Open

Cannot generate stub from .proto #1

n04ln opened this issue Jan 11, 2019 · 0 comments · May be fixed by #2

Comments

@n04ln
Copy link

n04ln commented Jan 11, 2019

Hi,

When I'm trying to use https://github.com/mwitkow/go-proto-validators, I got a bug.

put simply, look at following protofile.

syntax = "proto3";
package pkgname;

message A{
    B b = 1;
    message B {
        string c = 2;
    }
}

And try compile using protoc with retool,

$ retool do protoc --proto_path=${GOPATH}/src:. --twirp_out=. --twirp_dart_out=package_name=pkgname:./dart_client --go_out=. ./rpc/protobuf/service.proto

I got this code,

import 'dart:convert';
class A {

	A(
	this.b,);

    B b;
    
	
	factory A.fromJson(Map<String,dynamic> json) {
		

		return new A(
		new B.fromJson(json),
		
		);	
	}

	Map<String,dynamic>toJson() {
		var map = new Map<String, dynamic>();
		map['b'] = b.toJson();
		return map;
	}

  @override
  String toString() {
    return json.encode(toJson());
  }
}


It seems, not define message B in message A.

Thanks.

@n04ln n04ln linked a pull request Jan 12, 2019 that will close this issue
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.

1 participant