Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URI Template support in parameters #804

Merged
merged 13 commits into from
Jan 27, 2017
Merged

URI Template support in parameters #804

merged 13 commits into from
Jan 27, 2017

Conversation

darrelmiller
Copy link
Member

No description provided.

@@ -647,6 +647,9 @@ Field Name | Type | Description
<a name="parameterRequired"></a>required | `boolean` | Determines whether this parameter is mandatory. If the parameter is [`in`](#parameterIn) "path", this property is **required** and its value MUST be `true`. Otherwise, the property MAY be included and its default value is `false`.
<a name="parameterDeprecated"></a> deprecated | `boolean` | Specifies that a parameter is deprecated and should be transitioned out of usage.
<a name="parameterSchema"></a>schema | [Schema Object](#schemaObject) | The schema defining the type used for the parameter.
<a name="parameterEscape"></a>escape | `boolean` | Determines whether the parameter value should have unallowed characters percent-encoded based the parameter location. The default value is `true`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then:

/foo/{bar}

with bar = /baz/barf

we will have an issue with path matching

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apply just to header & path

@@ -647,6 +647,9 @@ Field Name | Type | Description
<a name="parameterRequired"></a>required | `boolean` | Determines whether this parameter is mandatory. If the parameter is [`in`](#parameterIn) "path", this property is **required** and its value MUST be `true`. Otherwise, the property MAY be included and its default value is `false`.
<a name="parameterDeprecated"></a> deprecated | `boolean` | Specifies that a parameter is deprecated and should be transitioned out of usage.
<a name="parameterSchema"></a>schema | [Schema Object](#schemaObject) | The schema defining the type used for the parameter.
<a name="parameterEscape"></a>escape | `boolean` | Determines whether the parameter value should have unallowed characters percent-encoded based the parameter location. The default value is `true`.
<a name="parameterStyle"></a>style | `string` | Determines rendering rules based on [RFC 6570](https://tools.ietf.org/html/rfc6570). Valid values include "matrix", "label", "segment", "simple". The style is only used when `in` has the value `path`. "matrix" refers to what RFC6570 calls "path-style". Default value is "simple".
<a name="parameterExplode"></a>explode | `boolean` | Indicates if the parameter values should rendered using the rules of the explode operator as defined in [RFC 6570](https://tools.ietf.org/html/rfc6570#section-2.2). Default value is `false`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we get rid of collectionFormat now? Let's review

@fehguy
Copy link
Contributor

fehguy commented Sep 30, 2016

@darrelmiller making two (or so) changes then this will be merged

@earth2marsh
Copy link
Member

This is more descriptive than 2.0, and it will increase the burden on tooling. For example, matrix parameters are most usually found in Java implementations, and now a project like a documentation generator might have to support matrix parameters in order to be "compliant" or "certified."

That's not a reason to stop the presses, just an observation. Hopefully we'll hear from tooling authors about this if it's a big problem.

@@ -529,7 +529,7 @@ This object can be extended with [Specification Extensions](#specificationExtens
"items": {
"type": "string"
},
"collectionFormat": "csv"
"style": "comma-delimited"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to camelCase

matrix | `string`, `array`, `object` | `path` | Path-style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7)
label | `string`, `array`, `object` | `path` | Label style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.5)
form | `string`, `array`, `object` | `query`| Form style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.8)
comma-delimited | `array` | `query`, `path` | Comma separated array values. This option replaces `collectionFormat` equal to `csv`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to camelCase

label | `string`, `array`, `object` | `path` | Label style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.5)
form | `string`, `array`, `object` | `query`| Form style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.8)
comma-delimited | `array` | `query`, `path` | Comma separated array values. This option replaces `collectionFormat` equal to `csv`.
space-delimited | `array` | `query`, `path` | Space separated array values. This option replaces `collectionFormat` equal to `ssv`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to camelCase

form | `string`, `array`, `object` | `query`| Form style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.8)
comma-delimited | `array` | `query`, `path` | Comma separated array values. This option replaces `collectionFormat` equal to `csv`.
space-delimited | `array` | `query`, `path` | Space separated array values. This option replaces `collectionFormat` equal to `ssv`.
pipe-delimited | `array` | `query`, `path` | Pipe separated array values. This option replaces `collectionFormat` equal to `pipes`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to camelCase

comma-delimited | `array` | `query`, `path` | Comma separated array values. This option replaces `collectionFormat` equal to `csv`.
space-delimited | `array` | `query`, `path` | Space separated array values. This option replaces `collectionFormat` equal to `ssv`.
pipe-delimited | `array` | `query`, `path` | Pipe separated array values. This option replaces `collectionFormat` equal to `pipes`.
deep-object | `object` | `query` | Provides a simple way of rendering nested objects using form parameters.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to camelCase

label | true | n/a | n/a | n/a | .x=100.y=200
form | false | . | value=hello | value=blue,black,brown | value=x,100,y,200
form | true | n/a | n/a | value=blue&value=black&value=brown | x=100&y=200
space-delimited | false | n/a | n/a | blue%20black%20brown | x%20100%20y%20200
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to camelCase

form | false | . | value=hello | value=blue,black,brown | value=x,100,y,200
form | true | n/a | n/a | value=blue&value=black&value=brown | x=100&y=200
space-delimited | false | n/a | n/a | blue%20black%20brown | x%20100%20y%20200
pipe-delimited | false | n/a | n/a | blue\|black\|brown | x\|100\|y\|200
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to camelCase

form | true | n/a | n/a | value=blue&value=black&value=brown | x=100&y=200
space-delimited | false | n/a | n/a | blue%20black%20brown | x%20100%20y%20200
pipe-delimited | false | n/a | n/a | blue\|black\|brown | x\|100\|y\|200
deep-object | true | n/a | n/a | n/a | person[name]=Bob&person[lastname]=Brown
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to camelCase

@@ -797,7 +834,7 @@ A header parameter with an array of 64 bit integer numbers:
"format": "int64"
}
},
"collectionFormat": "csv"
"style": "comma-delimited"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to camelCase

@@ -811,7 +848,7 @@ schema:
items:
type: integer
format: int64
collectionFormat: csv
style: comma-delimited
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to camelCase

[`style`](#dataTypeFormat) | `explode` | `empty` | `string` | `array` | `object`
----------- | ------ | -------- | -------- | --------|-------
matrix | false | ;value | ;value=hello | ;value=blue,black,brown | ;value=x,100,y200
matrix | true | n/a | n/a | ;value=blue;value=black;value=brown | ;x=100;y=100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@darrelmiller you had to re-think why we have n/a here

<a name="parameterFormat"></a>format | `string` | The extending format for the previously mentioned [`type`](#parameterType). See [Data Type Formats](#dataTypeFormat) for further details.
<a name="parameterStyle"></a>style | `string` | Describes how the parameter value will be serialized depending on the specified [`type`](#parameterType).
<a name="parameterAllowUnreserved"></a>allowReserved | `boolean` | Determines whether the parameter value should allow reserved characters `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. This property only applies to parameters with an `in` value of `query`. The default value is `false`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarify the source for the character list.

<a name="parameterFormat"></a>format | `string` | The extending format for the previously mentioned [`type`](#parameterType). See [Data Type Formats](#dataTypeFormat) for further details.
<a name="parameterStyle"></a>style | `string` | Describes how the parameter value will be serialized depending on the specified [`type`](#parameterType).
<a name="parameterAllowUnreserved"></a>allowReserved | `boolean` | Determines whether the parameter value should allow reserved characters `:/?#[]@!$&'()*+,;=` to be included without percent-encoding. This property only applies to parameters with an `in` value of `query`. The default value is `false`.
<a name="parameterExplode"></a>explode | `boolean` | When this is true, parameter values of type `array` or `object` generate seperate parameters for each value of the array, or key-value-pair of the map.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain that for an empty value or a primitive value explode is ignored.


`style` | [`type`](#dataTypeType) | `in` | Comments
----------- | ------ | -------- | --------
matrix | `string`, `array`, `object` | `path` | Path-style parameters defined by [RFC6570](https://tools.ietf.org/html/rfc6570#section-3.2.7)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everywhere it says string as the type, it should be primitive (it can be any primitive)

```
The following table shows examples of how those values would be rendered.

[`style`](#dataTypeFormat) | `explode` | `empty` | `string` | `array` | `object`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Header should be primitive instead of string

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=x,100,y,200
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

object example not updated

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=x,100,y,200
form | true | color= | color=blue | color=blue&color=black&color=brown | x=100&y=200
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

object example not updated

form | true | color= | color=blue | color=blue&color=black&color=brown | x=100&y=200
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|G\|150
deepObject | true | n/a | n/a | n/a | person[name]=Bob&person[lastname]=Brown
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wat

@bassmanitram
Copy link

Is there a "spec" of the templating features that this modification is intended to provide?
As it stands, for example, it doesn't seem to allow for "simple multi-segment" path parameterization (the cited "Dropbox" URI example cited in Issue 291)

@darrelmiller
Copy link
Member Author

@bassmanitram multi-path segments parameters are not supported. I attempted to explain why here #892 (comment)

AndersDJohnson pushed a commit to AndersDJohnson/OpenAPI-Specification that referenced this pull request Apr 8, 2019
URI Template support in parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants