Created by: aliakseiz
*Affects the Go-server only.
Limited support of integer array parameters in a query
Adds a code generation to parse query parameter fields of int32 array
and int64 array
types. Assumes that style: form
and explode: false
are used as serialization method.
openapi: "3.0.0"
info:
description: Example API
version: 1.0.0
title: "Example API"
servers:
- url: http://localhost:8080/api/v1
description: development server
paths:
/companies:
get:
summary: Filter companies by specified criteria
operationId: find
parameters:
- name: ids
in: query
example: "500, 501"
schema:
type: array
items:
type: integer
format: int64
tags:
- Company
responses:
200:
description: Successful operation
Before:
parentIDsParam := strings.Split(query.Get("ids"), ",")
After:
mtinfoIDsParam, err := parseInt64ArrayParameter(query.Get("ids"), ",", false)
if err != nil {
c.errorHandler(w, r, &ParsingError{Err: err}, nil)
return
}
Other
Fixes minor typos in comments.
Technical committee
@antihax @grokify @kemokemo @jirikuncar @ph4r5h4d
PR checklist
-
Read the contribution guidelines. -
Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community. -
Run the following to build the project and update samples: ./mvnw clean package ./bin/generate-samples.sh ./bin/utils/export_docs_generators.sh
./bin/generate-samples.sh bin/configs/java*
. For Windows users, please run the script in Git BASH. -
File the PR against the correct branch: master
(5.3.0),6.0.x
-
If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.