Skip to content

Update Style Values and Style Examples for consistency #3682

@charjr

Description

@charjr

What I Thought I Understood

Looking at Style Values what I grasp is this:

  • simple, spaceDelimited and pipeDelimited MUST be an array
  • deepObject MUST be an object
  • every other style can be a primitive, array or object
style type in Comments
matrix primitive, array, object path Path-style parameters defined by RFC6570
label primitive, array, object path Label style parameters defined by RFC6570
form primitive, array, object query, cookie Form style parameters defined by RFC6570. This option replaces collectionFormat with a csv (when explode is false) or multi (when explode is true) value from OpenAPI 2.0.
simple array path, header Simple style parameters defined by RFC6570. This option replaces collectionFormat with a csv value from OpenAPI 2.0.
spaceDelimited array query Space separated array values. This option replaces collectionFormat equal to ssv from OpenAPI 2.0.
pipeDelimited array query Pipe separated array values. This option replaces collectionFormat equal to pipes from OpenAPI 2.0.
deepObject object query Provides a simple way of rendering nested objects using form parameters.

What I Expect

What I expect to see when I look at Style Examples is this:

style explode empty string array object
matrix false ;color ;color=blue ;color=blue,black,brown ;color=R,100,G,200,B,150
matrix true ;color ;color=blue ;color=blue;color=black;color=brown ;R=100;G=200;B=150
label false . .blue .blue.black.brown .R.100.G.200.B.150
label true . .blue .blue.black.brown .R=100.G=200.B=150
form false color= color=blue color=blue,black,brown color=R,100,G,200,B,150
form true color= color=blue color=blue&color=black&color=brown R=100&G=200&B=150
simple false n/a n/a blue,black,brown n/a
simple true n/a n/a blue,black,brown n/a
spaceDelimited false n/a n/a blue%20black%20brown n/a
pipeDelimited false n/a n/a blue|black|brown n/a
deepObject true n/a n/a n/a color[R]=100&color[G]=200&color[B]=150

What I See

What I actually find on Style Examples is this:

  • simple can be primitive, array or object (which conflicts with what I read earlier)
  • spaceDelimited and pipeDelimited can be array or object (which conflicts with what I read earlier)
  • deepObject MUST be an object
  • everything else can be primitive, array or object
style explode empty string array object
matrix false ;color ;color=blue ;color=blue,black,brown ;color=R,100,G,200,B,150
matrix true ;color ;color=blue ;color=blue;color=black;color=brown ;R=100;G=200;B=150
label false . .blue .blue.black.brown .R.100.G.200.B.150
label true . .blue .blue.black.brown .R=100.G=200.B=150
form false color= color=blue color=blue,black,brown color=R,100,G,200,B,150
form true color= color=blue color=blue&color=black&color=brown R=100&G=200&B=150
simple false n/a blue blue,black,brown R,100,G,200,B,150
simple true n/a blue blue,black,brown R=100,G=200,B=150
spaceDelimited false n/a n/a blue%20black%20brown R%20100%20G%20200%20B%20150
pipeDelimited false n/a n/a blue|black|brown R|100|G|200|B|150
deepObject true n/a n/a n/a color[R]=100&color[G]=200&color[B]=150

What I Think Needs Correcting

Please correct me if I'm wrong, but my expectation is this:

style type in Comments
matrix primitive, array, object path Path-style parameters defined by RFC6570
label primitive, array, object path Label style parameters defined by RFC6570
form primitive, array, object query, cookie Form style parameters defined by RFC6570. This option replaces collectionFormat with a csv (when explode is false) or multi (when explode is true) value from OpenAPI 2.0.
simple primitive, array, object path, header Simple style parameters defined by RFC6570. This option replaces collectionFormat with a csv value from OpenAPI 2.0.
spaceDelimited array, object query Space separated array values. This option replaces collectionFormat equal to ssv from OpenAPI 2.0.
pipeDelimited array, object query Pipe separated array values. This option replaces collectionFormat equal to pipes from OpenAPI 2.0.
deepObject object query Provides a simple way of rendering nested objects using form parameters.

If this is the case, please let me know and I will make a PR to close it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    param serializationIssues related to parameter and/or header serialization

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions