Skip to content

[protoc-gen-openapiv2] Incorrectly generated OpenAPIv2 spec when using repeated_path_param_separator option #3696

Open
@Raiden1974

Description

@Raiden1974

🐛 Bug Report

When I use repeated_path_param_separator option with any value I get result in my documentation where "collectionFormat": "multi". I found what in template.go you force set 'multi' to "collectionFormat".

Activity

johanbrandhorst

johanbrandhorst commented on Oct 26, 2023

@johanbrandhorst
Collaborator

Hi, thanks for your bug report! It does indeed seem like the value set at https://github.com/grpc-ecosystem/grpc-gateway/blame/a6c12767cc494e67993e933ff4a501d667606d83/protoc-gen-openapiv2/internal/genopenapi/template.go#L1214C41-L1214C41 is overridden at https://github.com/grpc-ecosystem/grpc-gateway/blame/a6c12767cc494e67993e933ff4a501d667606d83/protoc-gen-openapiv2/internal/genopenapi/template.go#L333. I'm not sure exactly what the best fix is here, but I expect the command line flag should take precedence. Would you be willing to contribute a fix to this?

Raiden1974

Raiden1974 commented on Oct 27, 2023

@Raiden1974
Author

As I understand it, the same situation is in the gateway code generator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @johanbrandhorst@Raiden1974

      Issue actions

        [protoc-gen-openapiv2] Incorrectly generated OpenAPIv2 spec when using repeated_path_param_separator option · Issue #3696 · grpc-ecosystem/grpc-gateway