Created by: k0ral
An example will best illustrate the point of this pull-request. Take the following OpenAPI definition:
swagger: "2.0"
info:
title: MyModel
version: "1.0"
paths: {}
definitions:
MyModel:
type: object
properties:
color:
type: string
enum:
- RED
- BLUE
- GREEN
Without this pull-request, the generated protobuf file looks like:
message MyModel {
enum color {
RED = 0;
BLUE = 1;
GREEN = 2;
}
}
With this pull-request, the generated protobuf file looks like:
message MyModel {
enum ColorEnum {
RED = 0;
BLUE = 1;
GREEN = 2;
}
ColorEnum color = 1;
}
PR checklist
-
Read the contribution guidelines. -
If contributing template-only or documentation-only changes which will change sample output, build the project beforehand. -
Run the shell script ./bin/generate-samples.sh
to update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example./bin/generate-samples.sh bin/configs/java*
. For Windows users, please run the script in Git BASH. -
File the PR against the correct branch: master
-
Copy the technical committee to review the pull request if your PR is targeting a particular programming language.