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

Inconsistent escaping of raw path strings #37

Closed
neoeinstein opened this issue Mar 29, 2022 · 0 comments · Fixed by #67
Closed

Inconsistent escaping of raw path strings #37

neoeinstein opened this issue Mar 29, 2022 · 0 comments · Fixed by #67

Comments

@neoeinstein
Copy link
Contributor

Consider the following scenario:

File: test/package/v1/TestMessage.proto

syntax = "proto3";
package test.package.v1;
import "test/abstract/v1/target.proto";
message TestMessage {
    test.abstract.v1.Target target = 1;
}

File: test/abstract/v1/Target.proto

syntax = "proto3";
package test.abstract.v1;
message Target {
    bool example = 1;
}

When pbjson generates the Serialize/Deserialize impls, it will report the path to refer to Target as super::super::abstract::v1::Target. However, as abstract is a reserved keyword, this will fail to compile. The proper way to refer to this path is super::super::r#abstract::v1::Target. The prost generation correctly specifies this path.

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