File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -183,6 +183,18 @@ func (e *encoder) newPrimitiveTypeEncoder(t reflect.Type) encoderFunc {
183183func (e * encoder ) newArrayTypeEncoder (t reflect.Type ) encoderFunc {
184184 itemEncoder := e .typeEncoder (t .Elem ())
185185 keyFn := e .arrayKeyEncoder ()
186+ if e .arrayFmt == "comma" {
187+ return func (key string , v reflect.Value , writer * multipart.Writer ) error {
188+ if v .Len () == 0 {
189+ return nil
190+ }
191+ elements := make ([]string , v .Len ())
192+ for i := 0 ; i < v .Len (); i ++ {
193+ elements [i ] = fmt .Sprint (v .Index (i ).Interface ())
194+ }
195+ return writer .WriteField (key , strings .Join (elements , "," ))
196+ }
197+ }
186198 return func (key string , v reflect.Value , writer * multipart.Writer ) error {
187199 if keyFn == nil {
188200 return fmt .Errorf ("apiform: unsupported array format" )
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ if [ "$1" == "--daemon" ]; then
2424 # Pre-install the package so the download doesn't eat into the startup timeout
2525 npm exec --package=@stdy/cli@0.19.7 -- steady --version
2626
27- npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form -array-format=comma --validator-query -array-format=comma --validator-form -object-format=brackets --validator-query -object-format=brackets " $URL " & > .stdy.log &
27+ npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query -array-format=comma --validator-form -array-format=comma --validator-query -object-format=brackets --validator-form -object-format=brackets " $URL " & > .stdy.log &
2828
2929 # Wait for server to come online via health endpoint (max 30s)
3030 echo -n " Waiting for server"
@@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then
4848
4949 echo
5050else
51- npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form -array-format=comma --validator-query -array-format=comma --validator-form -object-format=brackets --validator-query -object-format=brackets " $URL "
51+ npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query -array-format=comma --validator-form -array-format=comma --validator-query -object-format=brackets --validator-form -object-format=brackets " $URL "
5252fi
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ elif ! steady_is_running ; then
4343 echo -e " To run the server, pass in the path or url of your OpenAPI"
4444 echo -e " spec to the steady command:"
4545 echo
46- echo -e " \$ ${YELLOW} npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form -array-format=comma --validator-query -array-format=comma --validator-form -object-format=brackets --validator-query -object-format=brackets${NC} "
46+ echo -e " \$ ${YELLOW} npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query -array-format=comma --validator-form -array-format=comma --validator-query -object-format=brackets --validator-form -object-format=brackets${NC} "
4747 echo
4848
4949 exit 1
You can’t perform that action at this time.
0 commit comments