proposed fix: Merging operations causes duplicate key/value pairs in "map" fields#460
Draft
sloretz wants to merge 2 commits intogoogle:mainfrom
Draft
proposed fix: Merging operations causes duplicate key/value pairs in "map" fields#460sloretz wants to merge 2 commits intogoogle:mainfrom
sloretz wants to merge 2 commits intogoogle:mainfrom
Conversation
…tation Signed-off-by: Shane Loretz <sloretz@intrinsic.ai>
Signed-off-by: Shane Loretz <sloretz@intrinsic.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Does this look like a change you'd accept?
I'd like to override the content-type annotation of a streaming API to
text/event-streamfor use with server-sent events. However, when I add anopenapi.v3.operationannotation and generate an OpenAPI spec I get a schema that lists two response types for"200".I'm assuming the problem is the proto file lists fields as
repeatedwithNamed...message types rather thanmap, and thisproto.Mergeappends those messages as if they were a list no matter what.gnostic/cmd/protoc-gen-openapi/generator/generator.go
Lines 756 to 760 in e0e09f7
I think the fix would be to write a custom merge function that resolves conflicts. My preference would be to keep the last annotation. For now I've only updated the tests to show the behavior I want to change. How does it look to you?