Using online code generator, it appears that collectionformat == “multi” is 
not respected.

 

*Online Swagger Codegen Version: *2.2.3

 

*Was this issue fixed in version 2.3.0?  Reference Link - *

https://github.com/swagger-api/swagger-codegen/pull/6199

 

If so, can the online generator be pushed to a later version?  2.3.0 
appears to have dropped in December and my work proxy will not allow me to 
download the maven jar file needed to take swagger codegen offline…

 

Generated API call, note Dictionary will never permit the repeating of the 
key of a key-value pair, and multi requires the repeat of the key in the 
query string.

 

  public ApiResponse< List<ElementVersion> > 
GetLatestElementVersionsWithHttpInfo (string pageLimit = null, string 
pageStart = null, List<string> id = null, List<string> elementName = null, 
List<string> nodeLabel = null, List<string> ruleName = null, List<string> 
elementId = null, List<string> nodeId = null, List<string> ruleId = null, 
List<string> baselineVersion = null, List<string> changeType = null, bool? 
exists = null, List<string> severity = null, List<string> timeDetected = 
null, List<string> timeReceived = null, List<string> promotionComment = null, 
List<string> approvalId = null, bool? outsideMaintenanceWindow = null, List<
string> scanId = null, List<string> md5 = null, List<string> sha1 = null, 
List<string> sha256 = null, List<string> sha512 = null, List<string> hash = 
null, string timeDetectedRange = null, string timeReceivedRange = null, bool? 
isPromoted = null, string severityRange = null)

        {

 

            var localVarPath = "/versions/latest";

            var localVarPathParams = new Dictionary<String, String>();

            var localVarQueryParams = new Dictionary<String, String>();

            var localVarHeaderParams = new Dictionary<String, 
String>(Configuration.DefaultHeader);

            var localVarFormParams = new Dictionary<String, String>();

            var localVarFileParams = new Dictionary<String, 
FileParameter>();

            Object localVarPostBody = null;

 

 

 

 

*Relevant section of ApiClient.mustache in Swagger Codegen:*

 

   /// <summary>

        /// Convert params to key/value pairs. 

        /// Use collectionFormat to properly format lists and collections.

        /// </summary>

        /// <param name="name">Key name.</param>

        /// <param name="value">Value object.</param>

        /// <returns>A list of KeyValuePairs</returns>

        public IEnumerable<KeyValuePair<string, string>> 
ParameterToKeyValuePairs(string collectionFormat, string name, object value)

        {

            var parameters = new List<KeyValuePair<string, string>>();

 

            if (IsCollection(value) && collectionFormat == "multi")

            {

                var valueCollection = value as IEnumerable;

                parameters.AddRange(from object item in valueCollection 
select new KeyValuePair<string, string>(name, ParameterToString(item)));

            }

            else

            {

                parameters.Add(new KeyValuePair<string, string>(name, 
ParameterToString(value)));

            }

 

            return parameters;

        }

 

*Relevant API Method from REST API json document:*

 

"/versions/latest":{"get":{"tags":["versions"],"summary":"Search for latest 
element versions only","description":"Returns only the most recent element 
version for each element that matches the search criteria.\nElement 
versions for nodes that the user does not have access to will be omitted 
from the search 
results.","operationId":"getLatestElementVersions","produces":["application/json"],"parameters":[{"name":"pageLimit","in":"query","description":"Page
 
limit for paging 
support","required":false,"type":"string"},{"name":"pageStart","in":"query","description":"Page
 
start for paging 
support","required":false,"type":"string"},{"name":"id","in":"query","description":"IDs
 
of element versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"elementName","in":"query","description":"Element
 
names of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"nodeLabel","in":"query","description":"Nodes
 
names of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"ruleName","in":"query","description":"Rules
 
names of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"elementId","in":"query","description":"Elements
 
IDs of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"nodeId","in":"query","description":"Nodes
 
IDs of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"ruleId","in":"query","description":"Rules
 
IDs of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"baselineVersion","in":"query","description":"Last
 
baseline versions of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"changeType","in":"query","description":"Change
 
types of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"exists","in":"query","description":"Exists
 
condition of elements versions to 
fetch.","required":false,"type":"boolean"},{"name":"severity","in":"query","description":"Severities
 
of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"timeDetected","in":"query","description":"Times
 
detected of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"timeReceived","in":"query","description":"Times
 
received of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"promotionComment","in":"query","description":"Promotion
 
comments of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"approvalId","in":"query","description":"Approval
 
IDs of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"outsideMaintenanceWindow","in":"query","description":"Outside
 
maintenance window condition of elements versions to 
fetch.","required":false,"type":"boolean"},{"name":"scanId","in":"query","description":"Scan
 
IDs of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"md5","in":"query","description":"MD5
 
hashes of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"sha1","in":"query","description":"SHA1
 
hashes of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"sha256","in":"query","description":"SHA256
 
hashes of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"sha512","in":"query","description":"SHA512
 
hashes of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"hash","in":"query","description":"Possible
 
Hashes value (md5, sha1, sha256, sha512) of elements versions to 
fetch.","required":false,"type":"array","items":{"type":"string"},"collectionFormat":"multi"},{"name":"timeDetectedRange","in":"query","description":"Time
 
detected range of element versions to 
fetch.","required":false,"type":"string"},{"name":"timeReceivedRange","in":"query","description":"Time
 
received range of element versions to 
fetch.","required":false,"type":"string"},{"name":"isPromoted","in":"query","description":"True
 
if the element version has been 
promoted.","required":false,"type":"boolean"},{"name":"severityRange","in":"query","description":"Filter
 
for element versions with severity in the comma separated range of values, 
inclusively","required":false,"type":"string"}],"responses":{"200":{"description":"successful
 
operation","schema":{"type":"array","items":{"$ref":"#/definitions/ElementVersion"}}},"400":{"description":"Invalid
 
data 
supplied","schema":{"$ref":"#/definitions/ErrorMessage"}},"401":{"description":"Unauthorized
 
(Unauthenticated 
user)","schema":{"$ref":"#/definitions/ErrorMessage"}},"403":{"description":"Forbidden
 
- required permissions: 
'tool.node.load'","schema":{"$ref":"#/definitions/ErrorMessage"}}}}},"/versions/promoteRequests":{"post":{"tags":["versions"],"summary":"Request
 
promotion of a set of element versions (since 1.11)","description":"Creates 
an asynchronous command to queue promotion of element 
versions.","operationId":"promoteRequest","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"body","description":"Version
 
creation request to be 
executed","required":true,"schema":{"$ref":"#/definitions/PromoteRequestCommand"}}],"responses":{"202":{"description":"Request
 
was successfully 
queued","schema":{"$ref":"#/definitions/PromoteRequestCommand"}},"400":{"description":"Invalid
 
data 
supplied","schema":{"$ref":"#/definitions/ErrorMessage"}},"401":{"description":"Unauthorized
 
(Unauthenticated 
user)","schema":{"$ref":"#/definitions/ErrorMessage"}},"403":{"description":"Forbidden
 
- required permissions: \"tool.node.load\" and ACL permission on Nodes for 
'element.update'","schema":{"$ref":"#/definitions/ErrorMessage"}}}}},"/versions/promoteRequests/{requestId}":{"get":{"tags":["versions"],"summary":"Get
 
promote request status (since 1.11)","description":"Returns the promote 
versions request along with the completion 
status.","operationId":"getPromoteRequestById","produces":["application/json"],"parameters":[{"name":"requestId","in":"path","description":"ID
 
of command to 
fetch","required":true,"type":"string"}],"responses":{"200":{"description":"successful
 
operation","schema":{"$ref":"#/definitions/CreateVersionRequest"}},"401":{"description":"Unauthorized
 
(Unauthenticated 
user)","schema":{"$ref":"#/definitions/ErrorMessage"}},"403":{"description":"Forbidden
 
- required permissions: 
\"tool.node.load\"","schema":{"$ref":"#/definitions/ErrorMessage"}},"404":{"description":"Command
 
not 
found","schema":{"$ref":"#/definitions/ErrorMessage"}}}}},"/versions/{rkVersionId}":{"get":{"tags":["versions"],"summary":"Get
 
element version details by ID","description":"Returns an element version 
with a specific 
ID.","operationId":"getElementVersionDetailsById","produces":["application/json"],"parameters":[{"name":"rkVersionId","in":"path","description":"ID
 
of element version details to 
fetch","required":true,"type":"string"}],"responses":{"200":{"description":"successful
 
operation","schema":{"$ref":"#/definitions/ElementVersion"}},"401":{"description":"Unauthorized
 
(Unauthenticated 
user)","schema":{"$ref":"#/definitions/ErrorMessage"}},"403":{"description":"Forbidden
 
- required permissions: 'tool.node.load' & ACL permission to view related 
node","schema":{"$ref":"#/definitions/ErrorMessage"}},"404":{"description":"Element
 
version details not found","schema"

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to