Skip to content

[Protobuf-Schema] Namespace updates #11115

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

Merged
merged 2 commits into from
Dec 17, 2021

Conversation

Yurzel
Copy link
Contributor

@Yurzel Yurzel commented Dec 14, 2021

resolve #11114

Codegen

  • fixed default packageName to openapitools
  • api mustache packageName changed to {{packageName}}.{{apiPackage}}.{{classname}}
  • package name changed to lowercase following the protobuf convention

@@ -10,7 +10,7 @@

syntax = "proto3";

package petstore;
package petstore.services.storeservice;
Copy link
Member

Choose a reason for hiding this comment

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

Would "petstore.services.store_service" be a better package name?

If that's the case, then I think we should use the lambda.underscore instead of lambda.lowercase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be honest I don't even like to put "class name" into the package. The official documentations says this:

Packages
Package name should be in lowercase, and should correspond to the directory hierarchy. e.g., if a file is in my/package/, then the package name should be my.package.

There is also an another way(?) to keep the original package name and then use some kind of prefix/postfix to the Request/Response message itself. I'm scared of ugly code generated by protoc tho.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the prompt reply and sorry that I forgot to mention why I think underscore should be used. It's based on this SO answer: https://stackoverflow.com/a/63228588/677735

@wing328 wing328 added this to the 5.3.1 milestone Dec 14, 2021
@wing328 wing328 merged commit 9b65513 into OpenAPITools:master Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REQ][Protobuf-Schema] Multiple services, same method collision
2 participants