autorest.typescript
autorest.typescript copied to clipboard
URI template support in RLC
fixes https://github.com/Azure/autorest.typescript/issues/2793 fixes https://github.com/Azure/autorest.typescript/issues/2792
Breakings
CollectionFormat with csv and multi are most commonly used cases, for csv
there is no breaking. And for multi
there will be a breaking and enabling the option compatibilityMode: true
would mitigate this breaking.
CollectionFormat with tsv is no longer supported and we are not aware of any real cases yet.
Possible values
- allowReserved: true/false
- value: primitive/array/object
- explode: true/false
- style: form/spaceDelimited/pipeDelimited
In-scoped cases
Path allowReserved
Support to define allowReserved for path parameter but the style and explode support for path parameter is not in-scope of this pr. The default for allowReserved would be
- allowReserved = false
allowReserved | Supported |
---|---|
true | y |
false | y |
Query expansion
Please note the allowReserved for query paremeter is not in scope of this pr. Except the form style we would also include the spaceDelimited and pipeDelimited mainly considering backward-compatibility. The default setting would be:
- style = form & explode = false
Style | Explode | Uri Template | Primitive value id = 5 | Array id = [3, 4, 5] | Object id = {"role": "admin", "firstName": "Alex"} | Supported |
---|---|---|---|---|---|---|
form | false | /users{?id} |
/users?id=5 |
/users?id=3,4,5 |
/users?id=role,admin,firstName,Alex |
y |
form* | true* | /users{?id*} |
/users?id=5 |
/users?id=3&id=4&id=5 |
/users?role=admin&firstName=Alex |
y |
spaceDelimited | false | n/a | n/a | /users?id=3%204%205 | n/a | y |
pipeDelimited | false | n/a | n/a | /users?id=3|4|5 |
n/a | y |
Out-of-scope cases
- tsv tab separated format(no real case yet.)
- Header expansion(header design is not changed and any support in header is out-of this pr's scope.)
- Path with explode
- Query with allowReserved