Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

collectionFormat 'multi' is not properly handled in generated code

オープン 初心者向け
#12,445 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
go
領域
api, tooling

調査の方向性

modules/swagger-codegen/src/main/resources/go/client.mustache の参照されているパラメーター処理関数から始め、次に modules/swagger-codegen/src/main/resources/python/api_client.mustache の multi collectionFormat の処理と比較します。swag init を使って例の宣言から Go クライアントを生成し、複数の値を持つ ids クエリが連結されるのではなく区切り文字付きで送信されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

Description

Query array declared with collectionFormat(multi) is not generated correctly, with ids concatenated without separator.

Swagger-codegen version

main branch

Swagger declaration file content or url
{
	"type": "array",
	"items": {
		"type": "string"
	},
	"collectionFormat": "multi",
	"description": "ids to query for objects",
	"name": "ids",
	"in": "query"
},
Command line used for generation

swag init

Steps to reproduce
  • Make a REST API endpoint which takes a list of ids and declare it with collectionFormat(multi)
    e.g. // @Param ids query []string false "ids to query for objects" collectionFormat(multi)
  • Generate API client with swagger-codegen for golang
  • Send a request to API with generated API client code and find on server side that ids are concatenated without separators
Related issues/PRs

Not related, but probably in similar area.
https://github.com/swagger-api/swagger-codegen/issues/10963

Suggest a fix/enhancement

Add handling for collectionFormat multi to the following function:
https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/go/client.mustache#L129

Similar to python
https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/python/api_client.mustache#L423

主要言語
Mustache
スター
17.8k
フォーク
6k
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

swagger-api/swagger-codegen のほかの issue

swagger-api/swagger-codegen の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。