proposed fix: Merging operations causes duplicate key/value pairs in "map" fields #460
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?