Azure / autorest.typescript

Extension for AutoRest (https://github.com/Azure/autorest) that generates TypeScript code. The transpiled javascript code is isomorphic. It can be run in browser and in node.js environment.
MIT License
179 stars 75 forks source link

URI template support in RLC #2814

Closed MaryGao closed 6 days ago

MaryGao commented 2 months ago

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 compatibilityQueryMultiFormat: true would mitigate this breaking.

CollectionFormat with tsv is no longer supported and we are not aware of any real cases yet.

Possible values

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 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 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