@typespec/http-specs 0.37.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (334) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/LICENSE +21 -0
  3. package/README.md +36 -0
  4. package/assets/image.jpg +0 -0
  5. package/assets/image.png +0 -0
  6. package/dist/specs/authentication/api-key/mockapi.d.ts +3 -0
  7. package/dist/specs/authentication/api-key/mockapi.d.ts.map +1 -0
  8. package/dist/specs/authentication/api-key/mockapi.js +45 -0
  9. package/dist/specs/authentication/api-key/mockapi.js.map +1 -0
  10. package/dist/specs/authentication/commonapi.d.ts +9 -0
  11. package/dist/specs/authentication/commonapi.d.ts.map +1 -0
  12. package/dist/specs/authentication/commonapi.js +19 -0
  13. package/dist/specs/authentication/commonapi.js.map +1 -0
  14. package/dist/specs/authentication/http/custom/mockapi.d.ts +3 -0
  15. package/dist/specs/authentication/http/custom/mockapi.d.ts.map +1 -0
  16. package/dist/specs/authentication/http/custom/mockapi.js +45 -0
  17. package/dist/specs/authentication/http/custom/mockapi.js.map +1 -0
  18. package/dist/specs/authentication/oauth2/mockapi.d.ts +3 -0
  19. package/dist/specs/authentication/oauth2/mockapi.d.ts.map +1 -0
  20. package/dist/specs/authentication/oauth2/mockapi.js +42 -0
  21. package/dist/specs/authentication/oauth2/mockapi.js.map +1 -0
  22. package/dist/specs/authentication/union/mockapi.d.ts +3 -0
  23. package/dist/specs/authentication/union/mockapi.d.ts.map +1 -0
  24. package/dist/specs/authentication/union/mockapi.js +37 -0
  25. package/dist/specs/authentication/union/mockapi.js.map +1 -0
  26. package/dist/specs/encode/bytes/mockapi.d.ts +3 -0
  27. package/dist/specs/encode/bytes/mockapi.d.ts.map +1 -0
  28. package/dist/specs/encode/bytes/mockapi.js +179 -0
  29. package/dist/specs/encode/bytes/mockapi.js.map +1 -0
  30. package/dist/specs/encode/datetime/mockapi.d.ts +3 -0
  31. package/dist/specs/encode/datetime/mockapi.d.ts.map +1 -0
  32. package/dist/specs/encode/datetime/mockapi.js +160 -0
  33. package/dist/specs/encode/datetime/mockapi.js.map +1 -0
  34. package/dist/specs/encode/duration/mockapi.d.ts +3 -0
  35. package/dist/specs/encode/duration/mockapi.d.ts.map +1 -0
  36. package/dist/specs/encode/duration/mockapi.js +116 -0
  37. package/dist/specs/encode/duration/mockapi.js.map +1 -0
  38. package/dist/specs/encode/numeric/mockapi.d.ts +3 -0
  39. package/dist/specs/encode/numeric/mockapi.d.ts.map +1 -0
  40. package/dist/specs/encode/numeric/mockapi.js +29 -0
  41. package/dist/specs/encode/numeric/mockapi.js.map +1 -0
  42. package/dist/specs/helper.d.ts +3 -0
  43. package/dist/specs/helper.d.ts.map +1 -0
  44. package/dist/specs/helper.js +7 -0
  45. package/dist/specs/helper.js.map +1 -0
  46. package/dist/specs/parameters/basic/mockapi.d.ts +3 -0
  47. package/dist/specs/parameters/basic/mockapi.d.ts.map +1 -0
  48. package/dist/specs/parameters/basic/mockapi.js +24 -0
  49. package/dist/specs/parameters/basic/mockapi.js.map +1 -0
  50. package/dist/specs/parameters/body-optionality/mockapi.d.ts +3 -0
  51. package/dist/specs/parameters/body-optionality/mockapi.d.ts.map +1 -0
  52. package/dist/specs/parameters/body-optionality/mockapi.js +62 -0
  53. package/dist/specs/parameters/body-optionality/mockapi.js.map +1 -0
  54. package/dist/specs/parameters/collection-format/mockapi.d.ts +3 -0
  55. package/dist/specs/parameters/collection-format/mockapi.d.ts.map +1 -0
  56. package/dist/specs/parameters/collection-format/mockapi.js +106 -0
  57. package/dist/specs/parameters/collection-format/mockapi.js.map +1 -0
  58. package/dist/specs/parameters/spread/mockapi.d.ts +3 -0
  59. package/dist/specs/parameters/spread/mockapi.d.ts.map +1 -0
  60. package/dist/specs/parameters/spread/mockapi.js +206 -0
  61. package/dist/specs/parameters/spread/mockapi.js.map +1 -0
  62. package/dist/specs/payload/json-merge-patch/mockapi.d.ts +40 -0
  63. package/dist/specs/payload/json-merge-patch/mockapi.d.ts.map +1 -0
  64. package/dist/specs/payload/json-merge-patch/mockapi.js +141 -0
  65. package/dist/specs/payload/json-merge-patch/mockapi.js.map +1 -0
  66. package/dist/specs/payload/media-type/mockapi.d.ts +3 -0
  67. package/dist/specs/payload/media-type/mockapi.d.ts.map +1 -0
  68. package/dist/specs/payload/media-type/mockapi.js +84 -0
  69. package/dist/specs/payload/media-type/mockapi.js.map +1 -0
  70. package/dist/specs/payload/multipart/mockapi.d.ts +3 -0
  71. package/dist/specs/payload/multipart/mockapi.d.ts.map +1 -0
  72. package/dist/specs/payload/multipart/mockapi.js +153 -0
  73. package/dist/specs/payload/multipart/mockapi.js.map +1 -0
  74. package/dist/specs/payload/xml/mockapi.d.ts +15 -0
  75. package/dist/specs/payload/xml/mockapi.d.ts.map +1 -0
  76. package/dist/specs/payload/xml/mockapi.js +189 -0
  77. package/dist/specs/payload/xml/mockapi.js.map +1 -0
  78. package/dist/specs/routes/mockapi.d.ts +3 -0
  79. package/dist/specs/routes/mockapi.d.ts.map +1 -0
  80. package/dist/specs/routes/mockapi.js +63 -0
  81. package/dist/specs/routes/mockapi.js.map +1 -0
  82. package/dist/specs/serialization/encoded-name/json/mockapi.d.ts +3 -0
  83. package/dist/specs/serialization/encoded-name/json/mockapi.d.ts.map +1 -0
  84. package/dist/specs/serialization/encoded-name/json/mockapi.js +32 -0
  85. package/dist/specs/serialization/encoded-name/json/mockapi.js.map +1 -0
  86. package/dist/specs/server/endpoint/not-defined/mockapi.d.ts +3 -0
  87. package/dist/specs/server/endpoint/not-defined/mockapi.d.ts.map +1 -0
  88. package/dist/specs/server/endpoint/not-defined/mockapi.js +15 -0
  89. package/dist/specs/server/endpoint/not-defined/mockapi.js.map +1 -0
  90. package/dist/specs/server/path/multiple/mockapi.d.ts +3 -0
  91. package/dist/specs/server/path/multiple/mockapi.d.ts.map +1 -0
  92. package/dist/specs/server/path/multiple/mockapi.js +27 -0
  93. package/dist/specs/server/path/multiple/mockapi.js.map +1 -0
  94. package/dist/specs/server/path/single/mockapi.d.ts +3 -0
  95. package/dist/specs/server/path/single/mockapi.d.ts.map +1 -0
  96. package/dist/specs/server/path/single/mockapi.js +15 -0
  97. package/dist/specs/server/path/single/mockapi.js.map +1 -0
  98. package/dist/specs/server/versions/not-versioned/mockapi.d.ts +3 -0
  99. package/dist/specs/server/versions/not-versioned/mockapi.d.ts.map +1 -0
  100. package/dist/specs/server/versions/not-versioned/mockapi.js +46 -0
  101. package/dist/specs/server/versions/not-versioned/mockapi.js.map +1 -0
  102. package/dist/specs/server/versions/versioned/mockapi.d.ts +3 -0
  103. package/dist/specs/server/versions/versioned/mockapi.d.ts.map +1 -0
  104. package/dist/specs/server/versions/versioned/mockapi.js +47 -0
  105. package/dist/specs/server/versions/versioned/mockapi.js.map +1 -0
  106. package/dist/specs/special-headers/conditional-request/mockapi.d.ts +3 -0
  107. package/dist/specs/special-headers/conditional-request/mockapi.d.ts.map +1 -0
  108. package/dist/specs/special-headers/conditional-request/mockapi.js +79 -0
  109. package/dist/specs/special-headers/conditional-request/mockapi.js.map +1 -0
  110. package/dist/specs/special-headers/repeatability/mockapi.d.ts +3 -0
  111. package/dist/specs/special-headers/repeatability/mockapi.d.ts.map +1 -0
  112. package/dist/specs/special-headers/repeatability/mockapi.js +36 -0
  113. package/dist/specs/special-headers/repeatability/mockapi.js.map +1 -0
  114. package/dist/specs/special-words/dec.d.ts +22 -0
  115. package/dist/specs/special-words/dec.d.ts.map +1 -0
  116. package/dist/specs/special-words/dec.js +37 -0
  117. package/dist/specs/special-words/dec.js.map +1 -0
  118. package/dist/specs/special-words/mockapi.d.ts +3 -0
  119. package/dist/specs/special-words/mockapi.d.ts.map +1 -0
  120. package/dist/specs/special-words/mockapi.js +246 -0
  121. package/dist/specs/special-words/mockapi.js.map +1 -0
  122. package/dist/specs/type/array/mockapi.d.ts +3 -0
  123. package/dist/specs/type/array/mockapi.d.ts.map +1 -0
  124. package/dist/specs/type/array/mockapi.js +104 -0
  125. package/dist/specs/type/array/mockapi.js.map +1 -0
  126. package/dist/specs/type/dictionary/mockapi.d.ts +3 -0
  127. package/dist/specs/type/dictionary/mockapi.d.ts.map +1 -0
  128. package/dist/specs/type/dictionary/mockapi.js +103 -0
  129. package/dist/specs/type/dictionary/mockapi.js.map +1 -0
  130. package/dist/specs/type/enum/extensible/mockapi.d.ts +3 -0
  131. package/dist/specs/type/enum/extensible/mockapi.d.ts.map +1 -0
  132. package/dist/specs/type/enum/extensible/mockapi.js +46 -0
  133. package/dist/specs/type/enum/extensible/mockapi.js.map +1 -0
  134. package/dist/specs/type/enum/fixed/mockapi.d.ts +3 -0
  135. package/dist/specs/type/enum/fixed/mockapi.d.ts.map +1 -0
  136. package/dist/specs/type/enum/fixed/mockapi.js +53 -0
  137. package/dist/specs/type/enum/fixed/mockapi.js.map +1 -0
  138. package/dist/specs/type/model/empty/mockapi.d.ts +3 -0
  139. package/dist/specs/type/model/empty/mockapi.d.ts.map +1 -0
  140. package/dist/specs/type/model/empty/mockapi.js +48 -0
  141. package/dist/specs/type/model/empty/mockapi.js.map +1 -0
  142. package/dist/specs/type/model/inheritance/enum-discriminator/mockapi.d.ts +3 -0
  143. package/dist/specs/type/model/inheritance/enum-discriminator/mockapi.d.ts.map +1 -0
  144. package/dist/specs/type/model/inheritance/enum-discriminator/mockapi.js +79 -0
  145. package/dist/specs/type/model/inheritance/enum-discriminator/mockapi.js.map +1 -0
  146. package/dist/specs/type/model/inheritance/nested-discriminator/mockapi.d.ts +3 -0
  147. package/dist/specs/type/model/inheritance/nested-discriminator/mockapi.d.ts.map +1 -0
  148. package/dist/specs/type/model/inheritance/nested-discriminator/mockapi.js +147 -0
  149. package/dist/specs/type/model/inheritance/nested-discriminator/mockapi.js.map +1 -0
  150. package/dist/specs/type/model/inheritance/not-discriminated/mockapi.d.ts +3 -0
  151. package/dist/specs/type/model/inheritance/not-discriminated/mockapi.d.ts.map +1 -0
  152. package/dist/specs/type/model/inheritance/not-discriminated/mockapi.js +47 -0
  153. package/dist/specs/type/model/inheritance/not-discriminated/mockapi.js.map +1 -0
  154. package/dist/specs/type/model/inheritance/recursive/mockapi.d.ts +3 -0
  155. package/dist/specs/type/model/inheritance/recursive/mockapi.d.ts.map +1 -0
  156. package/dist/specs/type/model/inheritance/recursive/mockapi.js +47 -0
  157. package/dist/specs/type/model/inheritance/recursive/mockapi.js.map +1 -0
  158. package/dist/specs/type/model/inheritance/single-discriminator/mockapi.d.ts +3 -0
  159. package/dist/specs/type/model/inheritance/single-discriminator/mockapi.d.ts.map +1 -0
  160. package/dist/specs/type/model/inheritance/single-discriminator/mockapi.js +122 -0
  161. package/dist/specs/type/model/inheritance/single-discriminator/mockapi.js.map +1 -0
  162. package/dist/specs/type/model/templated/mockapi.d.ts +3 -0
  163. package/dist/specs/type/model/templated/mockapi.d.ts.map +1 -0
  164. package/dist/specs/type/model/templated/mockapi.js +99 -0
  165. package/dist/specs/type/model/templated/mockapi.js.map +1 -0
  166. package/dist/specs/type/model/usage/mockapi.d.ts +3 -0
  167. package/dist/specs/type/model/usage/mockapi.d.ts.map +1 -0
  168. package/dist/specs/type/model/usage/mockapi.js +52 -0
  169. package/dist/specs/type/model/usage/mockapi.js.map +1 -0
  170. package/dist/specs/type/model/visibility/mockapi.d.ts +3 -0
  171. package/dist/specs/type/model/visibility/mockapi.d.ts.map +1 -0
  172. package/dist/specs/type/model/visibility/mockapi.js +138 -0
  173. package/dist/specs/type/model/visibility/mockapi.js.map +1 -0
  174. package/dist/specs/type/property/additional-properties/mockapi.d.ts +3 -0
  175. package/dist/specs/type/property/additional-properties/mockapi.d.ts.map +1 -0
  176. package/dist/specs/type/property/additional-properties/mockapi.js +346 -0
  177. package/dist/specs/type/property/additional-properties/mockapi.js.map +1 -0
  178. package/dist/specs/type/property/nullable/mockapi.d.ts +3 -0
  179. package/dist/specs/type/property/nullable/mockapi.d.ts.map +1 -0
  180. package/dist/specs/type/property/nullable/mockapi.js +147 -0
  181. package/dist/specs/type/property/nullable/mockapi.js.map +1 -0
  182. package/dist/specs/type/property/optionality/mockapi.d.ts +3 -0
  183. package/dist/specs/type/property/optionality/mockapi.d.ts.map +1 -0
  184. package/dist/specs/type/property/optionality/mockapi.js +197 -0
  185. package/dist/specs/type/property/optionality/mockapi.js.map +1 -0
  186. package/dist/specs/type/property/value-types/mockapi.d.ts +3 -0
  187. package/dist/specs/type/property/value-types/mockapi.d.ts.map +1 -0
  188. package/dist/specs/type/property/value-types/mockapi.js +213 -0
  189. package/dist/specs/type/property/value-types/mockapi.js.map +1 -0
  190. package/dist/specs/type/scalar/mockapi.d.ts +3 -0
  191. package/dist/specs/type/scalar/mockapi.d.ts.map +1 -0
  192. package/dist/specs/type/scalar/mockapi.js +274 -0
  193. package/dist/specs/type/scalar/mockapi.js.map +1 -0
  194. package/dist/specs/type/union/mockapi.d.ts +3 -0
  195. package/dist/specs/type/union/mockapi.d.ts.map +1 -0
  196. package/dist/specs/type/union/mockapi.js +113 -0
  197. package/dist/specs/type/union/mockapi.js.map +1 -0
  198. package/dist/specs/versioning/added/mockapi.d.ts +3 -0
  199. package/dist/specs/versioning/added/mockapi.d.ts.map +1 -0
  200. package/dist/specs/versioning/added/mockapi.js +76 -0
  201. package/dist/specs/versioning/added/mockapi.js.map +1 -0
  202. package/dist/specs/versioning/madeOptional/mockapi.d.ts +3 -0
  203. package/dist/specs/versioning/madeOptional/mockapi.d.ts.map +1 -0
  204. package/dist/specs/versioning/madeOptional/mockapi.js +24 -0
  205. package/dist/specs/versioning/madeOptional/mockapi.js.map +1 -0
  206. package/dist/specs/versioning/removed/mockapi.d.ts +3 -0
  207. package/dist/specs/versioning/removed/mockapi.d.ts.map +1 -0
  208. package/dist/specs/versioning/removed/mockapi.js +26 -0
  209. package/dist/specs/versioning/removed/mockapi.js.map +1 -0
  210. package/dist/specs/versioning/renamedFrom/mockapi.d.ts +3 -0
  211. package/dist/specs/versioning/renamedFrom/mockapi.d.ts.map +1 -0
  212. package/dist/specs/versioning/renamedFrom/mockapi.js +53 -0
  213. package/dist/specs/versioning/renamedFrom/mockapi.js.map +1 -0
  214. package/dist/specs/versioning/returnTypeChangedFrom/mockapi.d.ts +3 -0
  215. package/dist/specs/versioning/returnTypeChangedFrom/mockapi.d.ts.map +1 -0
  216. package/dist/specs/versioning/returnTypeChangedFrom/mockapi.js +25 -0
  217. package/dist/specs/versioning/returnTypeChangedFrom/mockapi.js.map +1 -0
  218. package/dist/specs/versioning/typeChangedFrom/mockapi.d.ts +3 -0
  219. package/dist/specs/versioning/typeChangedFrom/mockapi.d.ts.map +1 -0
  220. package/dist/specs/versioning/typeChangedFrom/mockapi.js +29 -0
  221. package/dist/specs/versioning/typeChangedFrom/mockapi.js.map +1 -0
  222. package/package.json +53 -0
  223. package/specs/README.md +3 -0
  224. package/specs/authentication/api-key/main.tsp +39 -0
  225. package/specs/authentication/api-key/mockapi.ts +47 -0
  226. package/specs/authentication/commonapi.ts +43 -0
  227. package/specs/authentication/http/custom/main.tsp +39 -0
  228. package/specs/authentication/http/custom/mockapi.ts +47 -0
  229. package/specs/authentication/oauth2/main.tsp +44 -0
  230. package/specs/authentication/oauth2/mockapi.ts +44 -0
  231. package/specs/authentication/union/main.tsp +29 -0
  232. package/specs/authentication/union/mockapi.ts +39 -0
  233. package/specs/encode/bytes/main.tsp +369 -0
  234. package/specs/encode/bytes/mockapi.ts +309 -0
  235. package/specs/encode/datetime/main.tsp +344 -0
  236. package/specs/encode/datetime/mockapi.ts +274 -0
  237. package/specs/encode/duration/main.tsp +322 -0
  238. package/specs/encode/duration/mockapi.ts +204 -0
  239. package/specs/encode/numeric/main.tsp +71 -0
  240. package/specs/encode/numeric/mockapi.ts +39 -0
  241. package/specs/helper.ts +8 -0
  242. package/specs/parameters/basic/main.tsp +61 -0
  243. package/specs/parameters/basic/mockapi.ts +29 -0
  244. package/specs/parameters/body-optionality/main.tsp +63 -0
  245. package/specs/parameters/body-optionality/mockapi.ts +71 -0
  246. package/specs/parameters/collection-format/main.tsp +95 -0
  247. package/specs/parameters/collection-format/mockapi.ts +113 -0
  248. package/specs/parameters/spread/main.tsp +340 -0
  249. package/specs/parameters/spread/mockapi.ts +216 -0
  250. package/specs/payload/json-merge-patch/main.tsp +183 -0
  251. package/specs/payload/json-merge-patch/mockapi.ts +146 -0
  252. package/specs/payload/media-type/main.tsp +54 -0
  253. package/specs/payload/media-type/mockapi.ts +88 -0
  254. package/specs/payload/multipart/main.tsp +499 -0
  255. package/specs/payload/multipart/mockapi.ts +226 -0
  256. package/specs/payload/xml/main.tsp +312 -0
  257. package/specs/payload/xml/mockapi.ts +244 -0
  258. package/specs/routes/main.tsp +476 -0
  259. package/specs/routes/mockapi.ts +158 -0
  260. package/specs/scratch/.gitignore +3 -0
  261. package/specs/serialization/encoded-name/json/main.tsp +45 -0
  262. package/specs/serialization/encoded-name/json/mockapi.ts +34 -0
  263. package/specs/server/endpoint/not-defined/main.tsp +19 -0
  264. package/specs/server/endpoint/not-defined/mockapi.ts +16 -0
  265. package/specs/server/path/multiple/main.tsp +46 -0
  266. package/specs/server/path/multiple/mockapi.ts +29 -0
  267. package/specs/server/path/single/main.tsp +23 -0
  268. package/specs/server/path/single/mockapi.ts +16 -0
  269. package/specs/server/versions/not-versioned/main.tsp +39 -0
  270. package/specs/server/versions/not-versioned/mockapi.ts +55 -0
  271. package/specs/server/versions/versioned/main.tsp +65 -0
  272. package/specs/server/versions/versioned/mockapi.ts +68 -0
  273. package/specs/special-headers/conditional-request/main.tsp +89 -0
  274. package/specs/special-headers/conditional-request/mockapi.ts +83 -0
  275. package/specs/special-headers/repeatability/main.tsp +39 -0
  276. package/specs/special-headers/repeatability/mockapi.ts +47 -0
  277. package/specs/special-words/dec.js +52 -0
  278. package/specs/special-words/main.tsp +238 -0
  279. package/specs/special-words/mockapi.ts +407 -0
  280. package/specs/type/array/main.tsp +132 -0
  281. package/specs/type/array/mockapi.ts +119 -0
  282. package/specs/type/dictionary/main.tsp +122 -0
  283. package/specs/type/dictionary/mockapi.ts +115 -0
  284. package/specs/type/enum/extensible/main.tsp +64 -0
  285. package/specs/type/enum/extensible/mockapi.ts +55 -0
  286. package/specs/type/enum/fixed/main.tsp +60 -0
  287. package/specs/type/enum/fixed/mockapi.ts +55 -0
  288. package/specs/type/model/empty/main.tsp +39 -0
  289. package/specs/type/model/empty/mockapi.ts +51 -0
  290. package/specs/type/model/inheritance/enum-discriminator/main.tsp +169 -0
  291. package/specs/type/model/inheritance/enum-discriminator/mockapi.ts +99 -0
  292. package/specs/type/model/inheritance/nested-discriminator/main.tsp +223 -0
  293. package/specs/type/model/inheritance/nested-discriminator/mockapi.ts +150 -0
  294. package/specs/type/model/inheritance/not-discriminated/main.tsp +53 -0
  295. package/specs/type/model/inheritance/not-discriminated/mockapi.ts +49 -0
  296. package/specs/type/model/inheritance/recursive/main.tsp +70 -0
  297. package/specs/type/model/inheritance/recursive/mockapi.ts +48 -0
  298. package/specs/type/model/inheritance/single-discriminator/main.tsp +171 -0
  299. package/specs/type/model/inheritance/single-discriminator/mockapi.ts +126 -0
  300. package/specs/type/model/templated/main.tsp +130 -0
  301. package/specs/type/model/templated/mockapi.ts +102 -0
  302. package/specs/type/model/usage/main.tsp +48 -0
  303. package/specs/type/model/usage/mockapi.ts +56 -0
  304. package/specs/type/model/visibility/main.tsp +152 -0
  305. package/specs/type/model/visibility/mockapi.ts +139 -0
  306. package/specs/type/property/additional-properties/main.tsp +591 -0
  307. package/specs/type/property/additional-properties/mockapi.ts +477 -0
  308. package/specs/type/property/nullable/client.tsp +21 -0
  309. package/specs/type/property/nullable/main.tsp +162 -0
  310. package/specs/type/property/nullable/mockapi.ts +202 -0
  311. package/specs/type/property/optionality/main.tsp +258 -0
  312. package/specs/type/property/optionality/mockapi.ts +308 -0
  313. package/specs/type/property/value-types/main.tsp +285 -0
  314. package/specs/type/property/value-types/mockapi.ts +297 -0
  315. package/specs/type/scalar/main.tsp +164 -0
  316. package/specs/type/scalar/mockapi.ts +280 -0
  317. package/specs/type/union/main.tsp +262 -0
  318. package/specs/type/union/mockapi.ts +137 -0
  319. package/specs/versioning/added/main.tsp +135 -0
  320. package/specs/versioning/added/mockapi.ts +79 -0
  321. package/specs/versioning/madeOptional/main.tsp +64 -0
  322. package/specs/versioning/madeOptional/mockapi.ts +25 -0
  323. package/specs/versioning/removed/main.tsp +125 -0
  324. package/specs/versioning/removed/mockapi.ts +27 -0
  325. package/specs/versioning/renamedFrom/main.tsp +111 -0
  326. package/specs/versioning/renamedFrom/mockapi.ts +55 -0
  327. package/specs/versioning/returnTypeChangedFrom/main.tsp +56 -0
  328. package/specs/versioning/returnTypeChangedFrom/mockapi.ts +26 -0
  329. package/specs/versioning/typeChangedFrom/main.tsp +70 -0
  330. package/specs/versioning/typeChangedFrom/mockapi.ts +30 -0
  331. package/temp/.tsbuildinfo +1 -0
  332. package/tsconfig.build.json +9 -0
  333. package/tsconfig.json +11 -0
  334. package/tspconfig.yaml +2 -0
@@ -0,0 +1,308 @@
1
+ import { json, MockRequest, passOnSuccess, ScenarioMockApi } from "@typespec/spec-api";
2
+
3
+ export const Scenarios: Record<string, ScenarioMockApi> = {};
4
+
5
+ function createServerTests(url: string, value: unknown) {
6
+ return {
7
+ get: passOnSuccess({
8
+ uri: url,
9
+ method: `get`,
10
+ request: {},
11
+ response: {
12
+ status: 200,
13
+ body: json(value),
14
+ },
15
+ handler: (req: MockRequest) => {
16
+ return {
17
+ status: 200,
18
+ body: json(value),
19
+ };
20
+ },
21
+ kind: "MockApiDefinition",
22
+ }),
23
+ put: passOnSuccess({
24
+ uri: url,
25
+ method: `put`,
26
+ request: {
27
+ body: value,
28
+ },
29
+ response: {
30
+ status: 204,
31
+ },
32
+ handler: (req: MockRequest) => {
33
+ req.expect.bodyEquals(value);
34
+ return {
35
+ status: 204,
36
+ };
37
+ },
38
+ kind: "MockApiDefinition",
39
+ }),
40
+ };
41
+ }
42
+
43
+ const Type_Property_Optional_String_Default = createServerTests(
44
+ `/type/property/optional/string/default`,
45
+ {},
46
+ );
47
+ const Type_Property_Optional_String_All = createServerTests(`/type/property/optional/string/all`, {
48
+ property: "hello",
49
+ });
50
+ Scenarios.Type_Property_Optional_String_getDefault = Type_Property_Optional_String_Default.get;
51
+ Scenarios.Type_Property_Optional_String_putDefault = Type_Property_Optional_String_Default.put;
52
+ Scenarios.Type_Property_Optional_String_getAll = Type_Property_Optional_String_All.get;
53
+ Scenarios.Type_Property_Optional_String_putAll = Type_Property_Optional_String_All.put;
54
+
55
+ const Type_Property_Optional_Bytes_Default = createServerTests(
56
+ `/type/property/optional/bytes/default`,
57
+ {},
58
+ );
59
+ const Type_Property_Optional_Bytes_All = createServerTests(`/type/property/optional/bytes/all`, {
60
+ property: "aGVsbG8sIHdvcmxkIQ==",
61
+ });
62
+ Scenarios.Type_Property_Optional_Bytes_getDefault = Type_Property_Optional_Bytes_Default.get;
63
+ Scenarios.Type_Property_Optional_Bytes_putDefault = Type_Property_Optional_Bytes_Default.put;
64
+ Scenarios.Type_Property_Optional_Bytes_getAll = Type_Property_Optional_Bytes_All.get;
65
+ Scenarios.Type_Property_Optional_Bytes_putAll = Type_Property_Optional_Bytes_All.put;
66
+
67
+ const Type_Property_Optional_DateTime_Default = createServerTests(
68
+ `/type/property/optional/datetime/default`,
69
+ {},
70
+ );
71
+ const Type_Property_Optional_DateTime_All = createServerTests(
72
+ `/type/property/optional/datetime/all`,
73
+ {
74
+ property: "2022-08-26T18:38:00Z",
75
+ },
76
+ );
77
+ Scenarios.Type_Property_Optional_Datetime_getDefault = Type_Property_Optional_DateTime_Default.get;
78
+ Scenarios.Type_Property_Optional_Datetime_putDefault = Type_Property_Optional_DateTime_Default.put;
79
+ Scenarios.Type_Property_Optional_Datetime_getAll = Type_Property_Optional_DateTime_All.get;
80
+ Scenarios.Type_Property_Optional_Datetime_putAll = Type_Property_Optional_DateTime_All.put;
81
+
82
+ const Type_Property_Optional_Duration_Default = createServerTests(
83
+ `/type/property/optional/duration/default`,
84
+ {},
85
+ );
86
+ const Type_Property_Optional_Duration_All = createServerTests(
87
+ `/type/property/optional/duration/all`,
88
+ {
89
+ property: "P123DT22H14M12.011S",
90
+ },
91
+ );
92
+
93
+ Scenarios.Type_Property_Optional_Duration_getDefault = Type_Property_Optional_Duration_Default.get;
94
+ Scenarios.Type_Property_Optional_Duration_putDefault = Type_Property_Optional_Duration_Default.put;
95
+ Scenarios.Type_Property_Optional_Duration_getAll = Type_Property_Optional_Duration_All.get;
96
+ Scenarios.Type_Property_Optional_Duration_putAll = Type_Property_Optional_Duration_All.put;
97
+
98
+ const Type_Property_Optional_PlainDate_Default = createServerTests(
99
+ `/type/property/optional/plainDate/default`,
100
+ {},
101
+ );
102
+ const Type_Property_Optional_PlainDate_All = createServerTests(
103
+ `/type/property/optional/plainDate/all`,
104
+ {
105
+ property: "2022-12-12",
106
+ },
107
+ );
108
+
109
+ Scenarios.Type_Property_Optional_PlainDate_getDefault =
110
+ Type_Property_Optional_PlainDate_Default.get;
111
+ Scenarios.Type_Property_Optional_PlainDate_putDefault =
112
+ Type_Property_Optional_PlainDate_Default.put;
113
+ Scenarios.Type_Property_Optional_PlainDate_getAll = Type_Property_Optional_PlainDate_All.get;
114
+ Scenarios.Type_Property_Optional_PlainDate_putAll = Type_Property_Optional_PlainDate_All.put;
115
+
116
+ const Type_Property_Optional_PlainTime_Default = createServerTests(
117
+ `/type/property/optional/plainTime/default`,
118
+ {},
119
+ );
120
+ const Type_Property_Optional_PlainTime_All = createServerTests(
121
+ `/type/property/optional/plainTime/all`,
122
+ {
123
+ property: "13:06:12",
124
+ },
125
+ );
126
+ Scenarios.Type_Property_Optional_PlainTime_getDefault =
127
+ Type_Property_Optional_PlainTime_Default.get;
128
+ Scenarios.Type_Property_Optional_PlainTime_putDefault =
129
+ Type_Property_Optional_PlainTime_Default.put;
130
+ Scenarios.Type_Property_Optional_PlainTime_getAll = Type_Property_Optional_PlainTime_All.get;
131
+ Scenarios.Type_Property_Optional_PlainTime_putAll = Type_Property_Optional_PlainTime_All.put;
132
+
133
+ const Type_Property_Optional_Collections_Bytes_Default = createServerTests(
134
+ `/type/property/optional/collections/bytes/default`,
135
+ {},
136
+ );
137
+ const Type_Property_Optional_Collections_Bytes_All = createServerTests(
138
+ `/type/property/optional/collections/bytes/all`,
139
+ { property: ["aGVsbG8sIHdvcmxkIQ==", "aGVsbG8sIHdvcmxkIQ=="] },
140
+ );
141
+
142
+ Scenarios.Type_Property_Optional_CollectionsByte_getDefault =
143
+ Type_Property_Optional_Collections_Bytes_Default.get;
144
+ Scenarios.Type_Property_Optional_CollectionsByte_putDefault =
145
+ Type_Property_Optional_Collections_Bytes_Default.put;
146
+ Scenarios.Type_Property_Optional_CollectionsByte_getAll =
147
+ Type_Property_Optional_Collections_Bytes_All.get;
148
+ Scenarios.Type_Property_Optional_CollectionsByte_putAll =
149
+ Type_Property_Optional_Collections_Bytes_All.put;
150
+
151
+ const Type_Property_Optional_Collections_Model_Default = createServerTests(
152
+ `/type/property/optional/collections/model/default`,
153
+ {},
154
+ );
155
+ const Type_Property_Optional_Collections_Model_All = createServerTests(
156
+ `/type/property/optional/collections/model/all`,
157
+ { property: [{ property: "hello" }, { property: "world" }] },
158
+ );
159
+ Scenarios.Type_Property_Optional_CollectionsModel_getDefault =
160
+ Type_Property_Optional_Collections_Model_Default.get;
161
+ Scenarios.Type_Property_Optional_CollectionsModel_putDefault =
162
+ Type_Property_Optional_Collections_Model_Default.put;
163
+ Scenarios.Type_Property_Optional_CollectionsModel_getAll =
164
+ Type_Property_Optional_Collections_Model_All.get;
165
+ Scenarios.Type_Property_Optional_CollectionsModel_putAll =
166
+ Type_Property_Optional_Collections_Model_All.put;
167
+
168
+ const Type_Property_Optional_String_Literal_Default = createServerTests(
169
+ `/type/property/optional/string/literal/default`,
170
+ {},
171
+ );
172
+ const Type_Property_Optional_String_Literal_All = createServerTests(
173
+ `/type/property/optional/string/literal/all`,
174
+ {
175
+ property: "hello",
176
+ },
177
+ );
178
+ Scenarios.Type_Property_Optional_StringLiteral_getDefault =
179
+ Type_Property_Optional_String_Literal_Default.get;
180
+ Scenarios.Type_Property_Optional_StringLiteral_putDefault =
181
+ Type_Property_Optional_String_Literal_Default.put;
182
+ Scenarios.Type_Property_Optional_StringLiteral_getAll =
183
+ Type_Property_Optional_String_Literal_All.get;
184
+ Scenarios.Type_Property_Optional_StringLiteral_putAll =
185
+ Type_Property_Optional_String_Literal_All.put;
186
+
187
+ const Type_Property_Optional_Int_Literal_Default = createServerTests(
188
+ `/type/property/optional/int/literal/default`,
189
+ {},
190
+ );
191
+ const Type_Property_Optional_Int_Literal_All = createServerTests(
192
+ `/type/property/optional/int/literal/all`,
193
+ {
194
+ property: 1,
195
+ },
196
+ );
197
+ Scenarios.Type_Property_Optional_IntLiteral_getDefault =
198
+ Type_Property_Optional_Int_Literal_Default.get;
199
+ Scenarios.Type_Property_Optional_IntLiteral_putDefault =
200
+ Type_Property_Optional_Int_Literal_Default.put;
201
+ Scenarios.Type_Property_Optional_IntLiteral_getAll = Type_Property_Optional_Int_Literal_All.get;
202
+ Scenarios.Type_Property_Optional_IntLiteral_putAll = Type_Property_Optional_Int_Literal_All.put;
203
+
204
+ const Type_Property_Optional_Float_Literal_Default = createServerTests(
205
+ `/type/property/optional/float/literal/default`,
206
+ {},
207
+ );
208
+ const Type_Property_Optional_Float_Literal_All = createServerTests(
209
+ `/type/property/optional/float/literal/all`,
210
+ {
211
+ property: 1.25,
212
+ },
213
+ );
214
+ Scenarios.Type_Property_Optional_FloatLiteral_getDefault =
215
+ Type_Property_Optional_Float_Literal_Default.get;
216
+ Scenarios.Type_Property_Optional_FloatLiteral_putDefault =
217
+ Type_Property_Optional_Float_Literal_Default.put;
218
+ Scenarios.Type_Property_Optional_FloatLiteral_getAll = Type_Property_Optional_Float_Literal_All.get;
219
+ Scenarios.Type_Property_Optional_FloatLiteral_putAll = Type_Property_Optional_Float_Literal_All.put;
220
+
221
+ const Type_Property_Optional_Boolean_Literal_Default = createServerTests(
222
+ `/type/property/optional/boolean/literal/default`,
223
+ {},
224
+ );
225
+ const Type_Property_Optional_Boolean_Literal_All = createServerTests(
226
+ `/type/property/optional/boolean/literal/all`,
227
+ { property: true },
228
+ );
229
+ Scenarios.Type_Property_Optional_BooleanLiteral_getDefault =
230
+ Type_Property_Optional_Boolean_Literal_Default.get;
231
+ Scenarios.Type_Property_Optional_BooleanLiteral_putDefault =
232
+ Type_Property_Optional_Boolean_Literal_Default.put;
233
+ Scenarios.Type_Property_Optional_BooleanLiteral_getAll =
234
+ Type_Property_Optional_Boolean_Literal_All.get;
235
+ Scenarios.Type_Property_Optional_BooleanLiteral_putAll =
236
+ Type_Property_Optional_Boolean_Literal_All.put;
237
+
238
+ const Type_Property_Optional_Union_String_Literal_Default = createServerTests(
239
+ `/type/property/optional/union/string/literal/default`,
240
+ {},
241
+ );
242
+ const Type_Property_Optional_Union_String_Literal_All = createServerTests(
243
+ `/type/property/optional/union/string/literal/all`,
244
+ { property: "world" },
245
+ );
246
+ Scenarios.Type_Property_Optional_UnionStringLiteral_getDefault =
247
+ Type_Property_Optional_Union_String_Literal_Default.get;
248
+ Scenarios.Type_Property_Optional_UnionStringLiteral_putDefault =
249
+ Type_Property_Optional_Union_String_Literal_Default.put;
250
+ Scenarios.Type_Property_Optional_UnionStringLiteral_getAll =
251
+ Type_Property_Optional_Union_String_Literal_All.get;
252
+ Scenarios.Type_Property_Optional_UnionStringLiteral_putAll =
253
+ Type_Property_Optional_Union_String_Literal_All.put;
254
+
255
+ const Type_Property_Optional_Union_Int_Literal_Default = createServerTests(
256
+ `/type/property/optional/union/int/literal/default`,
257
+ {},
258
+ );
259
+ const Type_Property_Optional_Union_Int_Literal_All = createServerTests(
260
+ `/type/property/optional/union/int/literal/all`,
261
+ { property: 2 },
262
+ );
263
+ Scenarios.Type_Property_Optional_UnionIntLiteral_getDefault =
264
+ Type_Property_Optional_Union_Int_Literal_Default.get;
265
+ Scenarios.Type_Property_Optional_UnionIntLiteral_putDefault =
266
+ Type_Property_Optional_Union_Int_Literal_Default.put;
267
+ Scenarios.Type_Property_Optional_UnionIntLiteral_getAll =
268
+ Type_Property_Optional_Union_Int_Literal_All.get;
269
+ Scenarios.Type_Property_Optional_UnionIntLiteral_putAll =
270
+ Type_Property_Optional_Union_Int_Literal_All.put;
271
+
272
+ const Type_Property_Optional_Union_Float_Literal_Default = createServerTests(
273
+ `/type/property/optional/union/float/literal/default`,
274
+ {},
275
+ );
276
+ const Type_Property_Optional_Union_Float_Literal_All = createServerTests(
277
+ `/type/property/optional/union/float/literal/all`,
278
+ { property: 2.375 },
279
+ );
280
+ Scenarios.Type_Property_Optional_UnionFloatLiteral_getDefault =
281
+ Type_Property_Optional_Union_Float_Literal_Default.get;
282
+ Scenarios.Type_Property_Optional_UnionFloatLiteral_putDefault =
283
+ Type_Property_Optional_Union_Float_Literal_Default.put;
284
+ Scenarios.Type_Property_Optional_UnionFloatLiteral_getAll =
285
+ Type_Property_Optional_Union_Float_Literal_All.get;
286
+ Scenarios.Type_Property_Optional_UnionFloatLiteral_putAll =
287
+ Type_Property_Optional_Union_Float_Literal_All.put;
288
+
289
+ const Type_Property_Optional_Required_And_Optional_RequiredOnly = createServerTests(
290
+ `/type/property/optional/requiredAndOptional/requiredOnly`,
291
+ { requiredProperty: 42 },
292
+ );
293
+ Scenarios.Type_Property_Optional_RequiredAndOptional_getRequiredOnly =
294
+ Type_Property_Optional_Required_And_Optional_RequiredOnly.get;
295
+ Scenarios.Type_Property_Optional_RequiredAndOptional_putRequiredOnly =
296
+ Type_Property_Optional_Required_And_Optional_RequiredOnly.put;
297
+
298
+ const Type_Property_Optional_Required_And_Optional_All = createServerTests(
299
+ `/type/property/optional/requiredAndOptional/all`,
300
+ {
301
+ optionalProperty: "hello",
302
+ requiredProperty: 42,
303
+ },
304
+ );
305
+ Scenarios.Type_Property_Optional_RequiredAndOptional_getAll =
306
+ Type_Property_Optional_Required_And_Optional_All.get;
307
+ Scenarios.Type_Property_Optional_RequiredAndOptional_putAll =
308
+ Type_Property_Optional_Required_And_Optional_All.put;
@@ -0,0 +1,285 @@
1
+ import "@typespec/http";
2
+ import "@typespec/spec-lib";
3
+
4
+ using TypeSpec.Http;
5
+ using Azure.ClientGenerator.Core;
6
+
7
+ @doc("Illustrates various property types for models")
8
+ @scenarioService("/type/property/value-types")
9
+ namespace Type.Property.ValueTypes;
10
+
11
+ // TEMPLATES
12
+ @doc("Template type for testing models with specific properties. Pass in the type of the property you are looking for")
13
+ model ModelTemplate<TProperty> {
14
+ @doc("Property")
15
+ property: TProperty;
16
+ }
17
+
18
+ @doc("Template to have models operations")
19
+ interface ModelOperations<TModel, TDoc extends string> {
20
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "For testing"
21
+ @scenario
22
+ @scenarioDoc(
23
+ """
24
+ Expected response body:
25
+ ```json
26
+ {"property": {doc}}
27
+ ```
28
+ """,
29
+ {
30
+ doc: TDoc,
31
+ }
32
+ )
33
+ @get
34
+ @doc("Get call")
35
+ get(): TModel;
36
+
37
+ #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "For testing"
38
+ @scenario
39
+ @scenarioDoc(
40
+ """
41
+ Expected input body:
42
+ ```json
43
+ {"property": {doc}}
44
+ ```
45
+ """,
46
+ {
47
+ doc: TDoc,
48
+ }
49
+ )
50
+ @put
51
+ @doc("Put operation")
52
+ put(@body @doc("body") body: TModel): void;
53
+ }
54
+
55
+ // Test a model with a boolean property
56
+ @doc("Model with a boolean property")
57
+ model BooleanProperty is ModelTemplate<boolean>;
58
+ @route("/boolean")
59
+ @operationGroup
60
+ interface Boolean extends ModelOperations<BooleanProperty, "true"> {}
61
+
62
+ // Test a model with a string property
63
+ @doc("Model with a string property")
64
+ model StringProperty is ModelTemplate<string>;
65
+ @route("/string")
66
+ @operationGroup
67
+ interface String extends ModelOperations<StringProperty, "\"hello\""> {}
68
+
69
+ // Test a model with a bytes property
70
+ @doc("Model with a bytes property")
71
+ model BytesProperty is ModelTemplate<bytes>;
72
+ @route("/bytes")
73
+ @operationGroup
74
+ interface Bytes extends ModelOperations<BytesProperty, "aGVsbG8sIHdvcmxkIQ=="> {}
75
+
76
+ // Test a model with an int property
77
+ @doc("Model with a int property")
78
+ model IntProperty is ModelTemplate<int32>;
79
+ @route("/int")
80
+ @operationGroup
81
+ interface Int extends ModelOperations<IntProperty, "42"> {}
82
+
83
+ // Test a model with a float property
84
+ @doc("Model with a float property")
85
+ model FloatProperty is ModelTemplate<float32>;
86
+ @route("/float")
87
+ @operationGroup
88
+ interface Float extends ModelOperations<FloatProperty, "43.125"> {}
89
+
90
+ // Test a model with a decimal property
91
+ @doc("Model with a decimal property")
92
+ model DecimalProperty is ModelTemplate<decimal>;
93
+ @route("/decimal")
94
+ @operationGroup
95
+ interface Decimal extends ModelOperations<DecimalProperty, "0.33333"> {}
96
+
97
+ // Test a model with a decimal128 property
98
+ @doc("Model with a decimal128 property")
99
+ model Decimal128Property is ModelTemplate<decimal128>;
100
+ @route("/decimal128")
101
+ @operationGroup
102
+ interface Decimal128 extends ModelOperations<Decimal128Property, "0.33333"> {}
103
+
104
+ // Test a model with a datetime property
105
+ @doc("Model with a datetime property")
106
+ model DatetimeProperty is ModelTemplate<utcDateTime>;
107
+ @route("/datetime")
108
+ @operationGroup
109
+ interface Datetime extends ModelOperations<DatetimeProperty, "2022-08-26T18:38:00Z"> {}
110
+
111
+ // Test a model with a duration property
112
+ @doc("Model with a duration property")
113
+ model DurationProperty is ModelTemplate<duration>;
114
+ @route("/duration")
115
+ @operationGroup
116
+ interface Duration extends ModelOperations<DurationProperty, "P123DT22H14M12.011S"> {}
117
+
118
+ // Test a model with an enum property
119
+ @doc("Enum that will be used as a property for model EnumProperty. Extensible.")
120
+ union InnerEnum {
121
+ string,
122
+
123
+ @doc("First value.")
124
+ ValueOne: "ValueOne",
125
+
126
+ @doc("Second value.")
127
+ ValueTwo: "ValueTwo",
128
+ }
129
+
130
+ #suppress "@azure-tools/typespec-azure-core/use-extensible-enum" "For testing"
131
+ @doc("Enum that will be used as a property for model EnumProperty. Non-extensible.")
132
+ @Azure.Core.fixed
133
+ enum FixedInnerEnum {
134
+ @doc("First value.")
135
+ ValueOne,
136
+
137
+ @doc("Second value.")
138
+ ValueTwo,
139
+ }
140
+
141
+ @doc("Model with enum properties")
142
+ model EnumProperty is ModelTemplate<FixedInnerEnum>;
143
+ @route("/enum")
144
+ @operationGroup
145
+ interface Enum extends ModelOperations<EnumProperty, "\"ValueOne\""> {}
146
+
147
+ @doc("Model with extensible enum properties")
148
+ model ExtensibleEnumProperty is ModelTemplate<InnerEnum>;
149
+ @route("/extensible-enum")
150
+ @operationGroup
151
+ interface ExtensibleEnum extends ModelOperations<ExtensibleEnumProperty, "\"UnknownValue\""> {}
152
+
153
+ // Test a model with a model property
154
+ @doc("Inner model. Will be a property type for ModelWithModelProperties")
155
+ model InnerModel {
156
+ @doc("Required string property")
157
+ property: string;
158
+ }
159
+ @doc("Model with model properties")
160
+ model ModelProperty is ModelTemplate<InnerModel>;
161
+ @route("/model")
162
+ @operationGroup
163
+ interface Model extends ModelOperations<ModelProperty, "{'property': 'hello'}"> {}
164
+
165
+ // Test a model with a string collection property
166
+ @doc("Model with collection string properties")
167
+ model CollectionsStringProperty is ModelTemplate<string[]>;
168
+ @route("/collections/string")
169
+ @operationGroup
170
+ interface CollectionsString
171
+ extends ModelOperations<CollectionsStringProperty, "['hello', 'world']"> {}
172
+
173
+ // Test a model with an int collection property
174
+ @doc("Model with collection int properties")
175
+ model CollectionsIntProperty is ModelTemplate<int32[]>;
176
+ @route("/collections/int")
177
+ @operationGroup
178
+ interface CollectionsInt extends ModelOperations<CollectionsIntProperty, "[1, 2]"> {}
179
+
180
+ // Test a model with a model collection property
181
+ @doc("Model with collection model properties")
182
+ model CollectionsModelProperty is ModelTemplate<InnerModel[]>;
183
+ @route("/collections/model")
184
+ @operationGroup
185
+ interface CollectionsModel
186
+ extends ModelOperations<
187
+ CollectionsModelProperty,
188
+ "[{'property': 'hello'}, {'property': 'world'}]"
189
+ > {}
190
+
191
+ // Test a model with a string dictionary property
192
+ @doc("Model with dictionary string properties")
193
+ model DictionaryStringProperty is ModelTemplate<Record<string>>;
194
+ @route("/dictionary/string")
195
+ @operationGroup
196
+ interface DictionaryString
197
+ extends ModelOperations<DictionaryStringProperty, "{'k1': 'hello', 'k2': 'world'}"> {}
198
+
199
+ // Test a model with a never property
200
+ @doc("Model with a property never. (This property should not be included).")
201
+ model NeverProperty is ModelTemplate<never>;
202
+ @route("/never")
203
+ @operationGroup
204
+ interface Never extends ModelOperations<NeverProperty, "<don't include this property>"> {}
205
+
206
+ // Test a model with unknown and string
207
+ @doc("Model with a property unknown, and the data is a string.")
208
+ model UnknownStringProperty is ModelTemplate<unknown>;
209
+ @route("/unknown/string")
210
+ @operationGroup
211
+ interface UnknownString extends ModelOperations<UnknownStringProperty, "\"hello\""> {}
212
+
213
+ // Test a model with unknown and int
214
+ @doc("Model with a property unknown, and the data is a int32.")
215
+ model UnknownIntProperty is ModelTemplate<unknown>;
216
+ @route("/unknown/int")
217
+ @operationGroup
218
+ interface UnknownInt extends ModelOperations<UnknownIntProperty, "42"> {}
219
+
220
+ // Test a model with unknown and a dictionnary
221
+ @doc("Model with a property unknown, and the data is a dictionnary.")
222
+ model UnknownDictProperty is ModelTemplate<unknown>;
223
+ @route("/unknown/dict")
224
+ @operationGroup
225
+ interface UnknownDict extends ModelOperations<UnknownDictProperty, "{'k1': 'hello', 'k2': 42}"> {}
226
+
227
+ // Test a model with unknown and an array
228
+ @doc("Model with a property unknown, and the data is an array.")
229
+ model UnknownArrayProperty is ModelTemplate<unknown>;
230
+ @route("/unknown/array")
231
+ @operationGroup
232
+ interface UnknownArray extends ModelOperations<UnknownArrayProperty, "['hello', 'world']"> {}
233
+
234
+ @doc("Model with a string literal property.")
235
+ model StringLiteralProperty is ModelTemplate<"hello">;
236
+ @route("/string/literal")
237
+ @operationGroup
238
+ interface StringLiteral extends ModelOperations<StringLiteralProperty, "\"hello\""> {}
239
+
240
+ @doc("Model with a int literal property.")
241
+ model IntLiteralProperty is ModelTemplate<42>;
242
+ @route("/int/literal")
243
+ @operationGroup
244
+ interface IntLiteral extends ModelOperations<IntLiteralProperty, "42"> {}
245
+
246
+ @doc("Model with a float literal property.")
247
+ model FloatLiteralProperty is ModelTemplate<43.125>;
248
+ @route("/float/literal")
249
+ @operationGroup
250
+ interface FloatLiteral extends ModelOperations<FloatLiteralProperty, "43.125"> {}
251
+
252
+ @doc("Model with a boolean literal property.")
253
+ model BooleanLiteralProperty is ModelTemplate<true>;
254
+ @route("/boolean/literal")
255
+ @operationGroup
256
+ interface BooleanLiteral extends ModelOperations<BooleanLiteralProperty, "true"> {}
257
+
258
+ @doc("Model with a union of string literal as property.")
259
+ model UnionStringLiteralProperty is ModelTemplate<"hello" | "world">;
260
+ @route("/union/string/literal")
261
+ @operationGroup
262
+ interface UnionStringLiteral extends ModelOperations<UnionStringLiteralProperty, "\"world\""> {}
263
+
264
+ @doc("Model with a union of int literal as property.")
265
+ model UnionIntLiteralProperty is ModelTemplate<42 | 43>;
266
+ @route("/union/int/literal")
267
+ @operationGroup
268
+ interface UnionIntLiteral extends ModelOperations<UnionIntLiteralProperty, "42"> {}
269
+
270
+ @doc("Model with a union of float literal as property.")
271
+ model UnionFloatLiteralProperty is ModelTemplate<43.125 | 46.875>;
272
+ @route("/union/float/literal")
273
+ @operationGroup
274
+ interface UnionFloatLiteral extends ModelOperations<UnionFloatLiteralProperty, "46.875"> {}
275
+
276
+ union ExtendedEnum {
277
+ string,
278
+ EnumValue2: "value2",
279
+ }
280
+
281
+ model UnionEnumValueProperty is ModelTemplate<ExtendedEnum.EnumValue2>;
282
+
283
+ @route("/union-enum-value")
284
+ @operationGroup
285
+ interface UnionEnumValue extends ModelOperations<UnionEnumValueProperty, "\"value2\""> {}