widdershins icon indicating copy to clipboard operation
widdershins copied to clipboard

widdershins output does not include parameter collectionFormat/array style information

Open DavidBiesack opened this issue 4 years ago • 5 comments

If a parameter type is an array with collectionFormat: (OpenAPI 2.0.0) or style: (OpenAPI 3.0.x), the output does not describe the format or string delimiter (comma for default, or | for pipes, etc.)

Input OpenAPI 2.0 and 3.0 attached.

openapi2.yaml.txt openapi3.yaml.txt

DavidBiesack avatar Mar 11 '20 14:03 DavidBiesack

By output, do you mean the representation of the parameter in code samples?

MikeRalphson avatar Mar 11 '20 14:03 MikeRalphson

It is not represented anywhere. I'd like to see it in the table that describes the parameters. It is just defined as array[string] The code samples do not show parameters.

DavidBiesack avatar Mar 11 '20 21:03 DavidBiesack

Ok, we're very constrained for space in the tables such as that for parameters. Any ideas for how to represent things would be gratefully received.

My comment about code samples referred to required query parameters, which do get included (in some templates).

MikeRalphson avatar Mar 20 '20 11:03 MikeRalphson

We have our own custom templates for parameters, so I can add include {{p.style}} in our layout. (We use a simpler two columns, Name in the left column, with optional <br>(**required**) if required, and Description column that contains the type `
description
constraints like minimum/maximum/readOnly, etc. so we can include the style with the other parameter metadata there.

For the generic case, I suggest augmenting the type column in parameters.def from array[string] to include the style after {{p.safeType}} such as one of

array[string]<br> style: pipeDelimited
array[string]<br> style: spaceDelimited
array[string]<br> style: simple

(maybe omit if it is the default form style??) You could insert a newline to keep the column narrower, since the param description often causes the parameter row to fold over multiple lines anyway.

DavidBiesack avatar Mar 21 '20 18:03 DavidBiesack

Hmm, good thoughts. I'd like to avoid leaking direct OpenAPI terminology such as style and explode though and make it more descriptive or use an example or links.

MikeRalphson avatar Mar 23 '20 09:03 MikeRalphson