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

Add language-specific code generation options to the generated OpenAPI .proto #3

Closed
timburks opened this issue Nov 29, 2016 · 3 comments
Assignees

Comments

@timburks
Copy link
Contributor

timburks commented Nov 29, 2016

Determine appropriate values for the following code generation options and add them (via @wora).

// This option lets the proto compiler generate Java code inside the package
// name (see below) instead of inside an outer class. It creates a simpler
// developer experience by reducing one-level of name nesting and be
// consistent with most programming languages that don't support outer classes.
option java_multiple_files = true;

// The Java outer classname should be the filename in UpperCamelCase. This
// class is only used to hold proto descriptor, so developers don't need to
// work with it directly.
option java_outer_classname = "XyzProto";

// The Java package name must be proto package name with proper prefix.
option java_package = "com.company.abc.xyz.v1";

// A reasonable prefix for the Objective-C symbols generated from the package.
// It should at a minimum be 3 characters long, all uppercase, and convention
// is to use an abbreviation of the package name. Something short, but
// hopefully unique enough to not conflict with things that may come along in
// the future. 'GPB' is reserved for the protocol buffer implementation itself.
//
option objc_class_prefix = "GABCX";
@timburks
Copy link
Contributor Author

Follow up question:

Should the Java package name be com.openapi.v2, org.openapi.v2, or something else?

@timburks timburks changed the title Add language-specific code generation options to generated proto Add language-specific code generation options to the generated OpenAPI .proto Nov 29, 2016
@timburks
Copy link
Contributor Author

I propose using the following values:

// This option lets the proto compiler generate Java code inside the package
// name (see below) instead of inside an outer class. It creates a simpler
// developer experience by reducing one-level of name nesting and be
// consistent with most programming languages that don't support outer classes.
option java_multiple_files = true;

// The Java outer classname should be the filename in UpperCamelCase. This
// class is only used to hold proto descriptor, so developers don't need to
// work with it directly.
option java_outer_classname = "OpenAPIProto";

// The Java package name must be proto package name with proper prefix.
option java_package = "org.openapi.v2";

// A reasonable prefix for the Objective-C symbols generated from the package.
// It should at a minimum be 3 characters long, all uppercase, and convention
// is to use an abbreviation of the package name. Something short, but
// hopefully unique enough to not conflict with things that may come along in
// the future. 'GPB' is reserved for the protocol buffer implementation itself.
//
option objc_class_prefix = "OAS"; // "OpenAPI Spec"

@timburks timburks self-assigned this Dec 1, 2016
timburks pushed a commit that referenced this issue Dec 19, 2016
Make default output files always get generated.
Remove need for giving -in flag
timburks pushed a commit that referenced this issue Dec 19, 2016
Make default output files always get generated.
Remove need for giving -in flag
@timburks
Copy link
Contributor Author

Done in this commit.

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

No branches or pull requests

1 participant