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

Namespaces / Packages in generated *.proto #539

Closed
wants to merge 4 commits into from

Conversation

TomGneuss
Copy link
Contributor

Previously, the *.proto files did not contain any hints about the namespace/package names in the target language. Thus, the protoc compiler just generated default namespaces.

Using the options as specified in this PR, the namespaces in the target languages of protoc are known beforehand.

@@ -484,6 +484,10 @@ def generate(

package {namespace};

option csharp_namespace = "AasCore.Aas3_0.Proto";
Copy link
Contributor

@mristin mristin Feb 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to insert the appropriately named package here. You need to import all the {lang. name}/naming.py.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's discuss it tomorrow

@mristin
Copy link
Contributor

mristin commented Feb 25, 2025

(Sorry for terse comment, reviewing and typing on my phone.)

@mristin
Copy link
Contributor

mristin commented Feb 26, 2025

After a call with @TomGneuss, we decided to close the issue, since we do not want to prime the users on the fixed namespace, as we do not plan to maintain the generated code. Hence, we decide to leave it open to the end-user (of the Protobuf definitions) to specify their own namespace.

A related issue in protoc: protocolbuffers/protobuf#6846

We suggest to semantically patch the *.proto file(s) in the future and add the namespace only once we start working on aas-core3.0-csharp-protobuf or aas-core3.0-java-protobuf.

@mristin mristin closed this Feb 26, 2025
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 this pull request may close these issues.

2 participants