Git Product home page Git Product logo

Comments (16)

bufdev avatar bufdev commented on June 12, 2024

Actually I think the problem here is additional_bindings.post and additional_bindings.body, these should be inside a additional_bindings { ... } block. I think that there may be an issue with both this repository and Prototool in this case.

from proto.

emicklei avatar emicklei commented on June 12, 2024

using this test

func TestParseNestedSelectorInAggregatedConstant(t *testing.T) {
	src := `rpc Test(Void) returns (Void) {
		option (google.api.http) = {
			get: "/api/v1/test"
			additional_bindings.post: "/api/v1/test"
			additional_bindings.body: "*"
		};
	}`
	p := newParserOn(src)
	rpc := new(RPC)
	p.next()
	err := rpc.parse(p)
	if err != nil {
		t.Fatal(err)
	}
}

i cannot reproduce this problem.
what version of the package is used by prototool?

from proto.

bufdev avatar bufdev commented on June 12, 2024

Prototool is using commit ff6be38 which is one commit back.

from proto.

bufdev avatar bufdev commented on June 12, 2024

See my last comment on uber/prototool#27

from proto.

emicklei avatar emicklei commented on June 12, 2024

can you have a look at the PR? I think it solves this issue

from proto.

bufdev avatar bufdev commented on June 12, 2024

I don't this this is fixed =-#81 did not add any testing for this. Can you check this? This also introduced a usage bug in #82.

Update: I see the testing and just added to it, the usage bug remains though, put up #83 to fix.

from proto.

johanbrandhorst avatar johanbrandhorst commented on June 12, 2024

What is the status of this issue?

from proto.

bufdev avatar bufdev commented on June 12, 2024

Reading this again, the only problem I see above is that it is invalid Protobuf - additional_bindings.post is not valid. I'm working on fixing the nested options problem in Prototool now. I don't see the problem with the semicolon, can you explain?

from proto.

bufdev avatar bufdev commented on June 12, 2024

test.proto:7:44:1:1:Error while parsing option value for "http": Expected "{", found ".". is due to the invalid nature of additional_bindings.post I believe.

from proto.

johanbrandhorst avatar johanbrandhorst commented on June 12, 2024

I think I got it wrong in the description, the dots are causing the problem, as you say.

from proto.

nilslice avatar nilslice commented on June 12, 2024

Hey folks - I believe I have another issue that may fit into this category.. when parsing a message like:

message AccountDirectory {
  option (common.ui_msg_desc) =
      "Account directory associates sites to providers like Accounts, CRM and Loyalty";

  int64 id = 1 [
    (common.ui_field_name) = "Account Directory ID",
    (common.ui_field_desc) = "ID of the account directory record."
  ];

  string name = 2 [
    (common.field_len) = 80,
    (common.ui_field_name) = "Account Directory Name",
    (common.ui_field_desc) =
        "Full name of the account directory (e.g., TEAM-NAME-USER-ACCT-DIR).",
    (validate.rules).string = {min_len : 3, max_len : 80}
  ];

  string description = 3 [
    (common.field_len) = 400,
    (common.ui_field_name) = "Account Domain Description",
    (common.ui_field_desc) = "Description of the account domain (e.g. Team,"
                             "Name User Account Directory).",
    (validate.rules).string = {min_len : 3, max_len : 400}
  ];
  
  AccountDomain account_domain = 4 [
    (common.ui_field_name) = "Account Domain",
    (common.ui_field_desc) = "Associated account domain identifier."
  ];
}

I get a parse error e.g.
<input>:54:30: found "\"Name User Account Directory).\"" but expected [option ,]

It seems that the parse step has an issue with lines being separated by the clang-format tool? I could be off with my assumption, but I was hoping this would add some context to this issue.

from proto.

emicklei avatar emicklei commented on June 12, 2024

@nilslice , thank you for reporting this

from proto.

emicklei avatar emicklei commented on June 12, 2024

see #85

from proto.

nilslice avatar nilslice commented on June 12, 2024

#85 fixes my reported issue. Thank you!

from proto.

emicklei avatar emicklei commented on June 12, 2024

can this issue be closed?

from proto.

johanbrandhorst avatar johanbrandhorst commented on June 12, 2024

I do think this is fixed.

from proto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.