-
Notifications
You must be signed in to change notification settings - Fork 926
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
Fix JsonSchemaGenerator to handle StructInfo with same alias and name #5788
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job 🔧🐸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
@jrhee17 I was wondering whether this could be added to the 1.29.1 milestone? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Sorry I'm late and thanks for the fix, @JonathanSawyer! 🙇 |
…#5788) Motivation: - The `StructInfo` `alias` has the same value as the `name` causing a duplicate key exception when building `typeSignatureToStructMappingBuilder`. - Occurred when setting up a HTTP service which consumes protobuf messages Modifications: - Checks that the `struct` and `alias` don't have the same name to avoid duplicate key exception (alias is created here https://github.com/line/armeria/blob/main/protobuf/src/main/java/com/linecorp/armeria/server/protobuf/ProtobufDescriptiveTypeInfoProvider.java#L106) Result: - Improves the `JsonSchemaGenerator.java` for the documentation service by allowing resources to have the same alias and name as is the default behavior of https://github.com/line/armeria/blob/main/protobuf/src/main/java/com/linecorp/armeria/server/protobuf/ProtobufDescriptiveTypeInfoProvider.java#L106 <!-- Visit this URL to learn more about how to write a pull request description: https://armeria.dev/community/developer-guide#how-to-write-pull-request-description -->
Tested and working 🙇 |
Motivation:
StructInfo
alias
has the same value as thename
causing a duplicate key exception when buildingtypeSignatureToStructMappingBuilder
.Modifications:
struct
andalias
don't have the same name to avoid duplicate key exception (alias is created here https://github.com/line/armeria/blob/main/protobuf/src/main/java/com/linecorp/armeria/server/protobuf/ProtobufDescriptiveTypeInfoProvider.java#L106)Result:
JsonSchemaGenerator.java
for the documentation service by allowing resources to have the same alias and name as is the default behavior of https://github.com/line/armeria/blob/main/protobuf/src/main/java/com/linecorp/armeria/server/protobuf/ProtobufDescriptiveTypeInfoProvider.java#L106