-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Swagger: JSON definitions aren't CamelCased #375
Comments
same problem. I think the schema.Properties = append(schema.Properties, keyVal{f.GetName(), fieldValue}) |
There has been a lot of work on the swagger definitions since this was filed and I think it's likely that this is fixed. If you have more issues please reopen/file a new issue. |
This is still an issue. f.GetName() is still being used, resulting in snake_case names rather than camelCase names in the generated swagger definitions. |
@alexleigh, looks like it is. Would you mind contributing a patch and helping out the community? It would be a great starter to get into the project. Just remember to run |
One of the recurring themes of this project has been trouble around the default marshaller. This change modifies it to be more what people expect when they first start the project. 1. It emits the proto3 json style version of field names instead of the field name as it appeared in the .proto file. 2. It emits zero values for fields. This means that if you have a field that is unset it will now have a value unlike before. Fixes: grpc-ecosystem#540, grpc-ecosystem#375, grpc-ecosystem#254, grpc-ecosystem#233
One of the recurring themes of this project has been trouble around the default marshaller. This change modifies it to be more what people expect when they first start the project. 1. It emits the proto3 json style version of field names instead of the field name as it appeared in the .proto file. 2. It emits zero values for fields. This means that if you have a field that is unset it will now have a value unlike before. Upgrade to swagger-codegen 2.4.0 Also fix a regex-o in .travis.yml. + needed to be escaped. Fixes: grpc-ecosystem#540, grpc-ecosystem#375, grpc-ecosystem#254, grpc-ecosystem#233
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I think we want to fix this for v2, if it's still an issue. |
Fixed in #1376 |
Example:
Go generator generates CamelCased JSON field
json="barBaz,omitempty"
, but gen-swagger takes raw name (bar_baz
).https://github.com/golang/protobuf/blob/master/protoc-gen-go/generator/generator.go#L1781
The text was updated successfully, but these errors were encountered: