@goast/kotlin 0.4.15 → 0.4.16-beta1

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 (529) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +45 -45
  3. package/assets/client/okhttp3/ApiClient.kt +252 -252
  4. package/esm/src/ast/references/java.d.ts +1 -0
  5. package/esm/src/ast/references/java.d.ts.map +1 -1
  6. package/esm/src/ast/references/java.js +1 -0
  7. package/esm/src/generators/models/model-generator.js +2 -2
  8. package/esm/src/generators/services/okhttp3-clients/args.d.ts +4 -0
  9. package/esm/src/generators/services/okhttp3-clients/args.d.ts.map +1 -1
  10. package/esm/src/generators/services/okhttp3-clients/okhttp3-client-generator.d.ts +1 -0
  11. package/esm/src/generators/services/okhttp3-clients/okhttp3-client-generator.d.ts.map +1 -1
  12. package/esm/src/generators/services/okhttp3-clients/okhttp3-client-generator.js +45 -32
  13. package/esm/src/generators/services/spring-controllers/args.d.ts +2 -0
  14. package/esm/src/generators/services/spring-controllers/args.d.ts.map +1 -1
  15. package/esm/src/generators/services/spring-controllers/spring-controller-generator.d.ts.map +1 -1
  16. package/esm/src/generators/services/spring-controllers/spring-controller-generator.js +37 -20
  17. package/package.json +2 -2
  18. package/script/src/ast/references/java.d.ts +1 -0
  19. package/script/src/ast/references/java.d.ts.map +1 -1
  20. package/script/src/ast/references/java.js +2 -1
  21. package/script/src/generators/models/model-generator.js +2 -2
  22. package/script/src/generators/services/okhttp3-clients/args.d.ts +4 -0
  23. package/script/src/generators/services/okhttp3-clients/args.d.ts.map +1 -1
  24. package/script/src/generators/services/okhttp3-clients/okhttp3-client-generator.d.ts +1 -0
  25. package/script/src/generators/services/okhttp3-clients/okhttp3-client-generator.d.ts.map +1 -1
  26. package/script/src/generators/services/okhttp3-clients/okhttp3-client-generator.js +45 -32
  27. package/script/src/generators/services/spring-controllers/args.d.ts +2 -0
  28. package/script/src/generators/services/spring-controllers/args.d.ts.map +1 -1
  29. package/script/src/generators/services/spring-controllers/spring-controller-generator.d.ts.map +1 -1
  30. package/script/src/generators/services/spring-controllers/spring-controller-generator.js +37 -20
  31. package/esm/_dnt.test_polyfills.d.ts +0 -29
  32. package/esm/_dnt.test_polyfills.d.ts.map +0 -1
  33. package/esm/_dnt.test_polyfills.js +0 -31
  34. package/esm/_dnt.test_shims.d.ts +0 -6
  35. package/esm/_dnt.test_shims.d.ts.map +0 -1
  36. package/esm/_dnt.test_shims.js +0 -61
  37. package/esm/deps/jsr.io/@std/assert/1.0.12/assertion_error.d.ts +0 -26
  38. package/esm/deps/jsr.io/@std/assert/1.0.12/assertion_error.d.ts.map +0 -1
  39. package/esm/deps/jsr.io/@std/assert/1.0.12/assertion_error.js +0 -30
  40. package/esm/deps/jsr.io/@std/assert/1.0.12/equal.d.ts +0 -17
  41. package/esm/deps/jsr.io/@std/assert/1.0.12/equal.d.ts.map +0 -1
  42. package/esm/deps/jsr.io/@std/assert/1.0.12/equal.js +0 -183
  43. package/esm/deps/jsr.io/@std/assert/1.0.12/equals.d.ts +0 -35
  44. package/esm/deps/jsr.io/@std/assert/1.0.12/equals.d.ts.map +0 -1
  45. package/esm/deps/jsr.io/@std/assert/1.0.12/equals.js +0 -58
  46. package/esm/deps/jsr.io/@std/assert/1.0.12/false.d.ts +0 -18
  47. package/esm/deps/jsr.io/@std/assert/1.0.12/false.d.ts.map +0 -1
  48. package/esm/deps/jsr.io/@std/assert/1.0.12/false.js +0 -22
  49. package/esm/deps/jsr.io/@std/assert/1.0.12/instance_of.d.ts +0 -23
  50. package/esm/deps/jsr.io/@std/assert/1.0.12/instance_of.d.ts.map +0 -1
  51. package/esm/deps/jsr.io/@std/assert/1.0.12/instance_of.js +0 -53
  52. package/esm/deps/jsr.io/@std/assert/1.0.12/is_error.d.ts +0 -25
  53. package/esm/deps/jsr.io/@std/assert/1.0.12/is_error.d.ts.map +0 -1
  54. package/esm/deps/jsr.io/@std/assert/1.0.12/is_error.js +0 -54
  55. package/esm/deps/jsr.io/@std/assert/1.0.12/match.d.ts +0 -18
  56. package/esm/deps/jsr.io/@std/assert/1.0.12/match.d.ts.map +0 -1
  57. package/esm/deps/jsr.io/@std/assert/1.0.12/match.js +0 -26
  58. package/esm/deps/jsr.io/@std/assert/1.0.12/not_instance_of.d.ts +0 -20
  59. package/esm/deps/jsr.io/@std/assert/1.0.12/not_instance_of.d.ts.map +0 -1
  60. package/esm/deps/jsr.io/@std/assert/1.0.12/not_instance_of.js +0 -29
  61. package/esm/deps/jsr.io/@std/assert/1.0.12/not_match.d.ts +0 -18
  62. package/esm/deps/jsr.io/@std/assert/1.0.12/not_match.d.ts.map +0 -1
  63. package/esm/deps/jsr.io/@std/assert/1.0.12/not_match.js +0 -26
  64. package/esm/deps/jsr.io/@std/assert/1.0.12/not_strict_equals.d.ts +0 -23
  65. package/esm/deps/jsr.io/@std/assert/1.0.12/not_strict_equals.d.ts.map +0 -1
  66. package/esm/deps/jsr.io/@std/assert/1.0.12/not_strict_equals.js +0 -32
  67. package/esm/deps/jsr.io/@std/assert/1.0.12/rejects.d.ts +0 -42
  68. package/esm/deps/jsr.io/@std/assert/1.0.12/rejects.d.ts.map +0 -1
  69. package/esm/deps/jsr.io/@std/assert/1.0.12/rejects.js +0 -53
  70. package/esm/deps/jsr.io/@std/assert/1.0.12/strict_equals.d.ts +0 -24
  71. package/esm/deps/jsr.io/@std/assert/1.0.12/strict_equals.d.ts.map +0 -1
  72. package/esm/deps/jsr.io/@std/assert/1.0.12/strict_equals.js +0 -57
  73. package/esm/deps/jsr.io/@std/expect/1.0.14/_assert_equals.d.ts +0 -20
  74. package/esm/deps/jsr.io/@std/expect/1.0.14/_assert_equals.d.ts.map +0 -1
  75. package/esm/deps/jsr.io/@std/expect/1.0.14/_assert_equals.js +0 -29
  76. package/esm/deps/jsr.io/@std/expect/1.0.14/_assert_is_error.d.ts +0 -14
  77. package/esm/deps/jsr.io/@std/expect/1.0.14/_assert_is_error.d.ts.map +0 -1
  78. package/esm/deps/jsr.io/@std/expect/1.0.14/_assert_is_error.js +0 -43
  79. package/esm/deps/jsr.io/@std/expect/1.0.14/_assert_not_equals.d.ts +0 -17
  80. package/esm/deps/jsr.io/@std/expect/1.0.14/_assert_not_equals.d.ts.map +0 -1
  81. package/esm/deps/jsr.io/@std/expect/1.0.14/_assert_not_equals.js +0 -26
  82. package/esm/deps/jsr.io/@std/expect/1.0.14/_assertions.d.ts +0 -4
  83. package/esm/deps/jsr.io/@std/expect/1.0.14/_assertions.d.ts.map +0 -1
  84. package/esm/deps/jsr.io/@std/expect/1.0.14/_assertions.js +0 -13
  85. package/esm/deps/jsr.io/@std/expect/1.0.14/_asymmetric_matchers.d.ts +0 -46
  86. package/esm/deps/jsr.io/@std/expect/1.0.14/_asymmetric_matchers.d.ts.map +0 -1
  87. package/esm/deps/jsr.io/@std/expect/1.0.14/_asymmetric_matchers.js +0 -161
  88. package/esm/deps/jsr.io/@std/expect/1.0.14/_build_message.d.ts +0 -6
  89. package/esm/deps/jsr.io/@std/expect/1.0.14/_build_message.d.ts.map +0 -1
  90. package/esm/deps/jsr.io/@std/expect/1.0.14/_build_message.js +0 -29
  91. package/esm/deps/jsr.io/@std/expect/1.0.14/_custom_equality_tester.d.ts +0 -4
  92. package/esm/deps/jsr.io/@std/expect/1.0.14/_custom_equality_tester.d.ts.map +0 -1
  93. package/esm/deps/jsr.io/@std/expect/1.0.14/_custom_equality_tester.js +0 -11
  94. package/esm/deps/jsr.io/@std/expect/1.0.14/_equal.d.ts +0 -9
  95. package/esm/deps/jsr.io/@std/expect/1.0.14/_equal.d.ts.map +0 -1
  96. package/esm/deps/jsr.io/@std/expect/1.0.14/_equal.js +0 -191
  97. package/esm/deps/jsr.io/@std/expect/1.0.14/_extend.d.ts +0 -4
  98. package/esm/deps/jsr.io/@std/expect/1.0.14/_extend.d.ts.map +0 -1
  99. package/esm/deps/jsr.io/@std/expect/1.0.14/_extend.js +0 -11
  100. package/esm/deps/jsr.io/@std/expect/1.0.14/_inspect_args.d.ts +0 -3
  101. package/esm/deps/jsr.io/@std/expect/1.0.14/_inspect_args.d.ts.map +0 -1
  102. package/esm/deps/jsr.io/@std/expect/1.0.14/_inspect_args.js +0 -12
  103. package/esm/deps/jsr.io/@std/expect/1.0.14/_matchers.d.ts +0 -34
  104. package/esm/deps/jsr.io/@std/expect/1.0.14/_matchers.d.ts.map +0 -1
  105. package/esm/deps/jsr.io/@std/expect/1.0.14/_matchers.js +0 -714
  106. package/esm/deps/jsr.io/@std/expect/1.0.14/_mock_util.d.ts +0 -11
  107. package/esm/deps/jsr.io/@std/expect/1.0.14/_mock_util.d.ts.map +0 -1
  108. package/esm/deps/jsr.io/@std/expect/1.0.14/_mock_util.js +0 -10
  109. package/esm/deps/jsr.io/@std/expect/1.0.14/_serializer.d.ts +0 -4
  110. package/esm/deps/jsr.io/@std/expect/1.0.14/_serializer.d.ts.map +0 -1
  111. package/esm/deps/jsr.io/@std/expect/1.0.14/_serializer.js +0 -10
  112. package/esm/deps/jsr.io/@std/expect/1.0.14/_types.d.ts +0 -843
  113. package/esm/deps/jsr.io/@std/expect/1.0.14/_types.d.ts.map +0 -1
  114. package/esm/deps/jsr.io/@std/expect/1.0.14/_types.js +0 -3
  115. package/esm/deps/jsr.io/@std/expect/1.0.14/_utils.d.ts +0 -9
  116. package/esm/deps/jsr.io/@std/expect/1.0.14/_utils.d.ts.map +0 -1
  117. package/esm/deps/jsr.io/@std/expect/1.0.14/_utils.js +0 -218
  118. package/esm/deps/jsr.io/@std/expect/1.0.14/expect.d.ts +0 -60
  119. package/esm/deps/jsr.io/@std/expect/1.0.14/expect.d.ts.map +0 -1
  120. package/esm/deps/jsr.io/@std/expect/1.0.14/expect.js +0 -523
  121. package/esm/deps/jsr.io/@std/internal/1.0.6/assertion_state.d.ts +0 -160
  122. package/esm/deps/jsr.io/@std/internal/1.0.6/assertion_state.d.ts.map +0 -1
  123. package/esm/deps/jsr.io/@std/internal/1.0.6/assertion_state.js +0 -200
  124. package/esm/deps/jsr.io/@std/internal/1.0.6/build_message.d.ts +0 -82
  125. package/esm/deps/jsr.io/@std/internal/1.0.6/build_message.d.ts.map +0 -1
  126. package/esm/deps/jsr.io/@std/internal/1.0.6/build_message.js +0 -111
  127. package/esm/deps/jsr.io/@std/internal/1.0.6/diff.d.ts +0 -140
  128. package/esm/deps/jsr.io/@std/internal/1.0.6/diff.d.ts.map +0 -1
  129. package/esm/deps/jsr.io/@std/internal/1.0.6/diff.js +0 -277
  130. package/esm/deps/jsr.io/@std/internal/1.0.6/diff_str.d.ts +0 -99
  131. package/esm/deps/jsr.io/@std/internal/1.0.6/diff_str.d.ts.map +0 -1
  132. package/esm/deps/jsr.io/@std/internal/1.0.6/diff_str.js +0 -183
  133. package/esm/deps/jsr.io/@std/internal/1.0.6/format.d.ts +0 -2
  134. package/esm/deps/jsr.io/@std/internal/1.0.6/format.d.ts.map +0 -1
  135. package/esm/deps/jsr.io/@std/internal/1.0.6/format.js +0 -37
  136. package/esm/deps/jsr.io/@std/internal/1.0.6/styles.d.ts +0 -159
  137. package/esm/deps/jsr.io/@std/internal/1.0.6/styles.d.ts.map +0 -1
  138. package/esm/deps/jsr.io/@std/internal/1.0.6/styles.js +0 -207
  139. package/esm/deps/jsr.io/@std/internal/1.0.6/types.d.ts +0 -16
  140. package/esm/deps/jsr.io/@std/internal/1.0.6/types.d.ts.map +0 -1
  141. package/esm/deps/jsr.io/@std/internal/1.0.6/types.js +0 -3
  142. package/esm/deps/jsr.io/@std/testing/1.0.10/_mock_utils.d.ts +0 -15
  143. package/esm/deps/jsr.io/@std/testing/1.0.10/_mock_utils.d.ts.map +0 -1
  144. package/esm/deps/jsr.io/@std/testing/1.0.10/_mock_utils.js +0 -35
  145. package/esm/deps/jsr.io/@std/testing/1.0.10/_test_suite.d.ts +0 -79
  146. package/esm/deps/jsr.io/@std/testing/1.0.10/_test_suite.d.ts.map +0 -1
  147. package/esm/deps/jsr.io/@std/testing/1.0.10/_test_suite.js +0 -380
  148. package/esm/deps/jsr.io/@std/testing/1.0.10/bdd.d.ts +0 -738
  149. package/esm/deps/jsr.io/@std/testing/1.0.10/bdd.d.ts.map +0 -1
  150. package/esm/deps/jsr.io/@std/testing/1.0.10/bdd.js +0 -654
  151. package/esm/deps/jsr.io/@std/testing/1.0.10/mock.d.ts +0 -674
  152. package/esm/deps/jsr.io/@std/testing/1.0.10/mock.d.ts.map +0 -1
  153. package/esm/deps/jsr.io/@std/testing/1.0.10/mock.js +0 -1083
  154. package/esm/src/ast/nodes/annotation.test.d.ts +0 -2
  155. package/esm/src/ast/nodes/annotation.test.d.ts.map +0 -1
  156. package/esm/src/ast/nodes/annotation.test.js +0 -56
  157. package/esm/src/ast/nodes/argument.test.d.ts +0 -2
  158. package/esm/src/ast/nodes/argument.test.d.ts.map +0 -1
  159. package/esm/src/ast/nodes/argument.test.js +0 -33
  160. package/esm/src/ast/nodes/call.test.d.ts +0 -2
  161. package/esm/src/ast/nodes/call.test.d.ts.map +0 -1
  162. package/esm/src/ast/nodes/call.test.js +0 -35
  163. package/esm/src/ast/nodes/class.test.d.ts +0 -2
  164. package/esm/src/ast/nodes/class.test.d.ts.map +0 -1
  165. package/esm/src/ast/nodes/class.test.js +0 -219
  166. package/esm/src/ast/nodes/constructor.test.d.ts +0 -2
  167. package/esm/src/ast/nodes/constructor.test.d.ts.map +0 -1
  168. package/esm/src/ast/nodes/constructor.test.js +0 -139
  169. package/esm/src/ast/nodes/doc-tag.test.d.ts +0 -2
  170. package/esm/src/ast/nodes/doc-tag.test.d.ts.map +0 -1
  171. package/esm/src/ast/nodes/doc-tag.test.js +0 -67
  172. package/esm/src/ast/nodes/doc.test.d.ts +0 -2
  173. package/esm/src/ast/nodes/doc.test.d.ts.map +0 -1
  174. package/esm/src/ast/nodes/doc.test.js +0 -33
  175. package/esm/src/ast/nodes/enum-value.test.d.ts +0 -2
  176. package/esm/src/ast/nodes/enum-value.test.d.ts.map +0 -1
  177. package/esm/src/ast/nodes/enum-value.test.js +0 -115
  178. package/esm/src/ast/nodes/enum.test.d.ts +0 -2
  179. package/esm/src/ast/nodes/enum.test.d.ts.map +0 -1
  180. package/esm/src/ast/nodes/enum.test.js +0 -129
  181. package/esm/src/ast/nodes/function.test.d.ts +0 -2
  182. package/esm/src/ast/nodes/function.test.d.ts.map +0 -1
  183. package/esm/src/ast/nodes/function.test.js +0 -160
  184. package/esm/src/ast/nodes/generic-parameter.test.d.ts +0 -2
  185. package/esm/src/ast/nodes/generic-parameter.test.d.ts.map +0 -1
  186. package/esm/src/ast/nodes/generic-parameter.test.js +0 -49
  187. package/esm/src/ast/nodes/init-block.test.d.ts +0 -2
  188. package/esm/src/ast/nodes/init-block.test.d.ts.map +0 -1
  189. package/esm/src/ast/nodes/init-block.test.js +0 -28
  190. package/esm/src/ast/nodes/interface.test.d.ts +0 -2
  191. package/esm/src/ast/nodes/interface.test.d.ts.map +0 -1
  192. package/esm/src/ast/nodes/interface.test.js +0 -121
  193. package/esm/src/ast/nodes/object.test.d.ts +0 -2
  194. package/esm/src/ast/nodes/object.test.d.ts.map +0 -1
  195. package/esm/src/ast/nodes/object.test.js +0 -78
  196. package/esm/src/ast/nodes/parameter.test.d.ts +0 -2
  197. package/esm/src/ast/nodes/parameter.test.d.ts.map +0 -1
  198. package/esm/src/ast/nodes/parameter.test.js +0 -152
  199. package/esm/src/ast/nodes/property.test.d.ts +0 -2
  200. package/esm/src/ast/nodes/property.test.d.ts.map +0 -1
  201. package/esm/src/ast/nodes/property.test.js +0 -206
  202. package/esm/src/ast/nodes/reference.test.d.ts +0 -2
  203. package/esm/src/ast/nodes/reference.test.d.ts.map +0 -1
  204. package/esm/src/ast/nodes/reference.test.js +0 -36
  205. package/esm/src/ast/nodes/string.test.d.ts +0 -2
  206. package/esm/src/ast/nodes/string.test.d.ts.map +0 -1
  207. package/esm/src/ast/nodes/string.test.js +0 -48
  208. package/esm/src/import-collection.test.d.ts +0 -2
  209. package/esm/src/import-collection.test.d.ts.map +0 -1
  210. package/esm/src/import-collection.test.js +0 -99
  211. package/esm/tests/openapi-models.test.d.ts +0 -2
  212. package/esm/tests/openapi-models.test.d.ts.map +0 -1
  213. package/esm/tests/openapi-models.test.js +0 -45
  214. package/script/_dnt.test_polyfills.d.ts +0 -29
  215. package/script/_dnt.test_polyfills.d.ts.map +0 -1
  216. package/script/_dnt.test_polyfills.js +0 -32
  217. package/script/_dnt.test_shims.d.ts +0 -6
  218. package/script/_dnt.test_shims.d.ts.map +0 -1
  219. package/script/_dnt.test_shims.js +0 -65
  220. package/script/deps/jsr.io/@std/assert/1.0.12/assertion_error.d.ts +0 -26
  221. package/script/deps/jsr.io/@std/assert/1.0.12/assertion_error.d.ts.map +0 -1
  222. package/script/deps/jsr.io/@std/assert/1.0.12/assertion_error.js +0 -34
  223. package/script/deps/jsr.io/@std/assert/1.0.12/equal.d.ts +0 -17
  224. package/script/deps/jsr.io/@std/assert/1.0.12/equal.d.ts.map +0 -1
  225. package/script/deps/jsr.io/@std/assert/1.0.12/equal.js +0 -187
  226. package/script/deps/jsr.io/@std/assert/1.0.12/equals.d.ts +0 -35
  227. package/script/deps/jsr.io/@std/assert/1.0.12/equals.d.ts.map +0 -1
  228. package/script/deps/jsr.io/@std/assert/1.0.12/equals.js +0 -61
  229. package/script/deps/jsr.io/@std/assert/1.0.12/false.d.ts +0 -18
  230. package/script/deps/jsr.io/@std/assert/1.0.12/false.d.ts.map +0 -1
  231. package/script/deps/jsr.io/@std/assert/1.0.12/false.js +0 -25
  232. package/script/deps/jsr.io/@std/assert/1.0.12/instance_of.d.ts +0 -23
  233. package/script/deps/jsr.io/@std/assert/1.0.12/instance_of.d.ts.map +0 -1
  234. package/script/deps/jsr.io/@std/assert/1.0.12/instance_of.js +0 -56
  235. package/script/deps/jsr.io/@std/assert/1.0.12/is_error.d.ts +0 -25
  236. package/script/deps/jsr.io/@std/assert/1.0.12/is_error.d.ts.map +0 -1
  237. package/script/deps/jsr.io/@std/assert/1.0.12/is_error.js +0 -57
  238. package/script/deps/jsr.io/@std/assert/1.0.12/match.d.ts +0 -18
  239. package/script/deps/jsr.io/@std/assert/1.0.12/match.d.ts.map +0 -1
  240. package/script/deps/jsr.io/@std/assert/1.0.12/match.js +0 -29
  241. package/script/deps/jsr.io/@std/assert/1.0.12/not_instance_of.d.ts +0 -20
  242. package/script/deps/jsr.io/@std/assert/1.0.12/not_instance_of.d.ts.map +0 -1
  243. package/script/deps/jsr.io/@std/assert/1.0.12/not_instance_of.js +0 -32
  244. package/script/deps/jsr.io/@std/assert/1.0.12/not_match.d.ts +0 -18
  245. package/script/deps/jsr.io/@std/assert/1.0.12/not_match.d.ts.map +0 -1
  246. package/script/deps/jsr.io/@std/assert/1.0.12/not_match.js +0 -29
  247. package/script/deps/jsr.io/@std/assert/1.0.12/not_strict_equals.d.ts +0 -23
  248. package/script/deps/jsr.io/@std/assert/1.0.12/not_strict_equals.d.ts.map +0 -1
  249. package/script/deps/jsr.io/@std/assert/1.0.12/not_strict_equals.js +0 -35
  250. package/script/deps/jsr.io/@std/assert/1.0.12/rejects.d.ts +0 -42
  251. package/script/deps/jsr.io/@std/assert/1.0.12/rejects.d.ts.map +0 -1
  252. package/script/deps/jsr.io/@std/assert/1.0.12/rejects.js +0 -56
  253. package/script/deps/jsr.io/@std/assert/1.0.12/strict_equals.d.ts +0 -24
  254. package/script/deps/jsr.io/@std/assert/1.0.12/strict_equals.d.ts.map +0 -1
  255. package/script/deps/jsr.io/@std/assert/1.0.12/strict_equals.js +0 -60
  256. package/script/deps/jsr.io/@std/expect/1.0.14/_assert_equals.d.ts +0 -20
  257. package/script/deps/jsr.io/@std/expect/1.0.14/_assert_equals.d.ts.map +0 -1
  258. package/script/deps/jsr.io/@std/expect/1.0.14/_assert_equals.js +0 -32
  259. package/script/deps/jsr.io/@std/expect/1.0.14/_assert_is_error.d.ts +0 -14
  260. package/script/deps/jsr.io/@std/expect/1.0.14/_assert_is_error.d.ts.map +0 -1
  261. package/script/deps/jsr.io/@std/expect/1.0.14/_assert_is_error.js +0 -46
  262. package/script/deps/jsr.io/@std/expect/1.0.14/_assert_not_equals.d.ts +0 -17
  263. package/script/deps/jsr.io/@std/expect/1.0.14/_assert_not_equals.d.ts.map +0 -1
  264. package/script/deps/jsr.io/@std/expect/1.0.14/_assert_not_equals.js +0 -29
  265. package/script/deps/jsr.io/@std/expect/1.0.14/_assertions.d.ts +0 -4
  266. package/script/deps/jsr.io/@std/expect/1.0.14/_assertions.d.ts.map +0 -1
  267. package/script/deps/jsr.io/@std/expect/1.0.14/_assertions.js +0 -18
  268. package/script/deps/jsr.io/@std/expect/1.0.14/_asymmetric_matchers.d.ts +0 -46
  269. package/script/deps/jsr.io/@std/expect/1.0.14/_asymmetric_matchers.d.ts.map +0 -1
  270. package/script/deps/jsr.io/@std/expect/1.0.14/_asymmetric_matchers.js +0 -183
  271. package/script/deps/jsr.io/@std/expect/1.0.14/_build_message.d.ts +0 -6
  272. package/script/deps/jsr.io/@std/expect/1.0.14/_build_message.d.ts.map +0 -1
  273. package/script/deps/jsr.io/@std/expect/1.0.14/_build_message.js +0 -33
  274. package/script/deps/jsr.io/@std/expect/1.0.14/_custom_equality_tester.d.ts +0 -4
  275. package/script/deps/jsr.io/@std/expect/1.0.14/_custom_equality_tester.d.ts.map +0 -1
  276. package/script/deps/jsr.io/@std/expect/1.0.14/_custom_equality_tester.js +0 -15
  277. package/script/deps/jsr.io/@std/expect/1.0.14/_equal.d.ts +0 -9
  278. package/script/deps/jsr.io/@std/expect/1.0.14/_equal.d.ts.map +0 -1
  279. package/script/deps/jsr.io/@std/expect/1.0.14/_equal.js +0 -194
  280. package/script/deps/jsr.io/@std/expect/1.0.14/_extend.d.ts +0 -4
  281. package/script/deps/jsr.io/@std/expect/1.0.14/_extend.d.ts.map +0 -1
  282. package/script/deps/jsr.io/@std/expect/1.0.14/_extend.js +0 -15
  283. package/script/deps/jsr.io/@std/expect/1.0.14/_inspect_args.d.ts +0 -3
  284. package/script/deps/jsr.io/@std/expect/1.0.14/_inspect_args.d.ts.map +0 -1
  285. package/script/deps/jsr.io/@std/expect/1.0.14/_inspect_args.js +0 -17
  286. package/script/deps/jsr.io/@std/expect/1.0.14/_matchers.d.ts +0 -34
  287. package/script/deps/jsr.io/@std/expect/1.0.14/_matchers.d.ts.map +0 -1
  288. package/script/deps/jsr.io/@std/expect/1.0.14/_matchers.js +0 -748
  289. package/script/deps/jsr.io/@std/expect/1.0.14/_mock_util.d.ts +0 -11
  290. package/script/deps/jsr.io/@std/expect/1.0.14/_mock_util.d.ts.map +0 -1
  291. package/script/deps/jsr.io/@std/expect/1.0.14/_mock_util.js +0 -14
  292. package/script/deps/jsr.io/@std/expect/1.0.14/_serializer.d.ts +0 -4
  293. package/script/deps/jsr.io/@std/expect/1.0.14/_serializer.d.ts.map +0 -1
  294. package/script/deps/jsr.io/@std/expect/1.0.14/_serializer.js +0 -14
  295. package/script/deps/jsr.io/@std/expect/1.0.14/_types.d.ts +0 -843
  296. package/script/deps/jsr.io/@std/expect/1.0.14/_types.d.ts.map +0 -1
  297. package/script/deps/jsr.io/@std/expect/1.0.14/_types.js +0 -4
  298. package/script/deps/jsr.io/@std/expect/1.0.14/_utils.d.ts +0 -9
  299. package/script/deps/jsr.io/@std/expect/1.0.14/_utils.d.ts.map +0 -1
  300. package/script/deps/jsr.io/@std/expect/1.0.14/_utils.js +0 -226
  301. package/script/deps/jsr.io/@std/expect/1.0.14/expect.d.ts +0 -60
  302. package/script/deps/jsr.io/@std/expect/1.0.14/expect.d.ts.map +0 -1
  303. package/script/deps/jsr.io/@std/expect/1.0.14/expect.js +0 -527
  304. package/script/deps/jsr.io/@std/internal/1.0.6/assertion_state.d.ts +0 -160
  305. package/script/deps/jsr.io/@std/internal/1.0.6/assertion_state.d.ts.map +0 -1
  306. package/script/deps/jsr.io/@std/internal/1.0.6/assertion_state.js +0 -205
  307. package/script/deps/jsr.io/@std/internal/1.0.6/build_message.d.ts +0 -82
  308. package/script/deps/jsr.io/@std/internal/1.0.6/build_message.d.ts.map +0 -1
  309. package/script/deps/jsr.io/@std/internal/1.0.6/build_message.js +0 -116
  310. package/script/deps/jsr.io/@std/internal/1.0.6/diff.d.ts +0 -140
  311. package/script/deps/jsr.io/@std/internal/1.0.6/diff.d.ts.map +0 -1
  312. package/script/deps/jsr.io/@std/internal/1.0.6/diff.js +0 -284
  313. package/script/deps/jsr.io/@std/internal/1.0.6/diff_str.d.ts +0 -99
  314. package/script/deps/jsr.io/@std/internal/1.0.6/diff_str.d.ts.map +0 -1
  315. package/script/deps/jsr.io/@std/internal/1.0.6/diff_str.js +0 -189
  316. package/script/deps/jsr.io/@std/internal/1.0.6/format.d.ts +0 -2
  317. package/script/deps/jsr.io/@std/internal/1.0.6/format.d.ts.map +0 -1
  318. package/script/deps/jsr.io/@std/internal/1.0.6/format.js +0 -41
  319. package/script/deps/jsr.io/@std/internal/1.0.6/styles.d.ts +0 -159
  320. package/script/deps/jsr.io/@std/internal/1.0.6/styles.d.ts.map +0 -1
  321. package/script/deps/jsr.io/@std/internal/1.0.6/styles.js +0 -220
  322. package/script/deps/jsr.io/@std/internal/1.0.6/types.d.ts +0 -16
  323. package/script/deps/jsr.io/@std/internal/1.0.6/types.d.ts.map +0 -1
  324. package/script/deps/jsr.io/@std/internal/1.0.6/types.js +0 -4
  325. package/script/deps/jsr.io/@std/testing/1.0.10/_mock_utils.d.ts +0 -15
  326. package/script/deps/jsr.io/@std/testing/1.0.10/_mock_utils.d.ts.map +0 -1
  327. package/script/deps/jsr.io/@std/testing/1.0.10/_mock_utils.js +0 -41
  328. package/script/deps/jsr.io/@std/testing/1.0.10/_test_suite.d.ts +0 -79
  329. package/script/deps/jsr.io/@std/testing/1.0.10/_test_suite.d.ts.map +0 -1
  330. package/script/deps/jsr.io/@std/testing/1.0.10/_test_suite.js +0 -385
  331. package/script/deps/jsr.io/@std/testing/1.0.10/bdd.d.ts +0 -738
  332. package/script/deps/jsr.io/@std/testing/1.0.10/bdd.d.ts.map +0 -1
  333. package/script/deps/jsr.io/@std/testing/1.0.10/bdd.js +0 -665
  334. package/script/deps/jsr.io/@std/testing/1.0.10/mock.d.ts +0 -674
  335. package/script/deps/jsr.io/@std/testing/1.0.10/mock.d.ts.map +0 -1
  336. package/script/deps/jsr.io/@std/testing/1.0.10/mock.js +0 -1102
  337. package/script/src/ast/nodes/annotation.test.d.ts +0 -2
  338. package/script/src/ast/nodes/annotation.test.d.ts.map +0 -1
  339. package/script/src/ast/nodes/annotation.test.js +0 -58
  340. package/script/src/ast/nodes/argument.test.d.ts +0 -2
  341. package/script/src/ast/nodes/argument.test.d.ts.map +0 -1
  342. package/script/src/ast/nodes/argument.test.js +0 -35
  343. package/script/src/ast/nodes/call.test.d.ts +0 -2
  344. package/script/src/ast/nodes/call.test.d.ts.map +0 -1
  345. package/script/src/ast/nodes/call.test.js +0 -37
  346. package/script/src/ast/nodes/class.test.d.ts +0 -2
  347. package/script/src/ast/nodes/class.test.d.ts.map +0 -1
  348. package/script/src/ast/nodes/class.test.js +0 -221
  349. package/script/src/ast/nodes/constructor.test.d.ts +0 -2
  350. package/script/src/ast/nodes/constructor.test.d.ts.map +0 -1
  351. package/script/src/ast/nodes/constructor.test.js +0 -141
  352. package/script/src/ast/nodes/doc-tag.test.d.ts +0 -2
  353. package/script/src/ast/nodes/doc-tag.test.d.ts.map +0 -1
  354. package/script/src/ast/nodes/doc-tag.test.js +0 -69
  355. package/script/src/ast/nodes/doc.test.d.ts +0 -2
  356. package/script/src/ast/nodes/doc.test.d.ts.map +0 -1
  357. package/script/src/ast/nodes/doc.test.js +0 -35
  358. package/script/src/ast/nodes/enum-value.test.d.ts +0 -2
  359. package/script/src/ast/nodes/enum-value.test.d.ts.map +0 -1
  360. package/script/src/ast/nodes/enum-value.test.js +0 -117
  361. package/script/src/ast/nodes/enum.test.d.ts +0 -2
  362. package/script/src/ast/nodes/enum.test.d.ts.map +0 -1
  363. package/script/src/ast/nodes/enum.test.js +0 -131
  364. package/script/src/ast/nodes/function.test.d.ts +0 -2
  365. package/script/src/ast/nodes/function.test.d.ts.map +0 -1
  366. package/script/src/ast/nodes/function.test.js +0 -162
  367. package/script/src/ast/nodes/generic-parameter.test.d.ts +0 -2
  368. package/script/src/ast/nodes/generic-parameter.test.d.ts.map +0 -1
  369. package/script/src/ast/nodes/generic-parameter.test.js +0 -51
  370. package/script/src/ast/nodes/init-block.test.d.ts +0 -2
  371. package/script/src/ast/nodes/init-block.test.d.ts.map +0 -1
  372. package/script/src/ast/nodes/init-block.test.js +0 -30
  373. package/script/src/ast/nodes/interface.test.d.ts +0 -2
  374. package/script/src/ast/nodes/interface.test.d.ts.map +0 -1
  375. package/script/src/ast/nodes/interface.test.js +0 -123
  376. package/script/src/ast/nodes/object.test.d.ts +0 -2
  377. package/script/src/ast/nodes/object.test.d.ts.map +0 -1
  378. package/script/src/ast/nodes/object.test.js +0 -80
  379. package/script/src/ast/nodes/parameter.test.d.ts +0 -2
  380. package/script/src/ast/nodes/parameter.test.d.ts.map +0 -1
  381. package/script/src/ast/nodes/parameter.test.js +0 -154
  382. package/script/src/ast/nodes/property.test.d.ts +0 -2
  383. package/script/src/ast/nodes/property.test.d.ts.map +0 -1
  384. package/script/src/ast/nodes/property.test.js +0 -208
  385. package/script/src/ast/nodes/reference.test.d.ts +0 -2
  386. package/script/src/ast/nodes/reference.test.d.ts.map +0 -1
  387. package/script/src/ast/nodes/reference.test.js +0 -38
  388. package/script/src/ast/nodes/string.test.d.ts +0 -2
  389. package/script/src/ast/nodes/string.test.d.ts.map +0 -1
  390. package/script/src/ast/nodes/string.test.js +0 -50
  391. package/script/src/import-collection.test.d.ts +0 -2
  392. package/script/src/import-collection.test.d.ts.map +0 -1
  393. package/script/src/import-collection.test.js +0 -101
  394. package/script/tests/openapi-models.test.d.ts +0 -2
  395. package/script/tests/openapi-models.test.d.ts.map +0 -1
  396. package/script/tests/openapi-models.test.js +0 -48
  397. package/src/_dnt.test_polyfills.ts +0 -70
  398. package/src/_dnt.test_shims.ts +0 -64
  399. package/src/deps/jsr.io/@std/assert/1.0.12/assertion_error.ts +0 -31
  400. package/src/deps/jsr.io/@std/assert/1.0.12/equal.ts +0 -210
  401. package/src/deps/jsr.io/@std/assert/1.0.12/equals.ts +0 -65
  402. package/src/deps/jsr.io/@std/assert/1.0.12/false.ts +0 -26
  403. package/src/deps/jsr.io/@std/assert/1.0.12/instance_of.ts +0 -64
  404. package/src/deps/jsr.io/@std/assert/1.0.12/is_error.ts +0 -65
  405. package/src/deps/jsr.io/@std/assert/1.0.12/match.ts +0 -30
  406. package/src/deps/jsr.io/@std/assert/1.0.12/not_instance_of.ts +0 -33
  407. package/src/deps/jsr.io/@std/assert/1.0.12/not_match.ts +0 -30
  408. package/src/deps/jsr.io/@std/assert/1.0.12/not_strict_equals.ts +0 -42
  409. package/src/deps/jsr.io/@std/assert/1.0.12/rejects.ts +0 -123
  410. package/src/deps/jsr.io/@std/assert/1.0.12/strict_equals.ts +0 -67
  411. package/src/deps/jsr.io/@std/expect/1.0.14/_assert_equals.ts +0 -38
  412. package/src/deps/jsr.io/@std/expect/1.0.14/_assert_is_error.ts +0 -54
  413. package/src/deps/jsr.io/@std/expect/1.0.14/_assert_not_equals.ts +0 -35
  414. package/src/deps/jsr.io/@std/expect/1.0.14/_assertions.ts +0 -18
  415. package/src/deps/jsr.io/@std/expect/1.0.14/_asymmetric_matchers.ts +0 -198
  416. package/src/deps/jsr.io/@std/expect/1.0.14/_build_message.ts +0 -51
  417. package/src/deps/jsr.io/@std/expect/1.0.14/_custom_equality_tester.ts +0 -19
  418. package/src/deps/jsr.io/@std/expect/1.0.14/_equal.ts +0 -230
  419. package/src/deps/jsr.io/@std/expect/1.0.14/_extend.ts +0 -16
  420. package/src/deps/jsr.io/@std/expect/1.0.14/_inspect_args.ts +0 -15
  421. package/src/deps/jsr.io/@std/expect/1.0.14/_matchers.ts +0 -1028
  422. package/src/deps/jsr.io/@std/expect/1.0.14/_mock_util.ts +0 -22
  423. package/src/deps/jsr.io/@std/expect/1.0.14/_serializer.ts +0 -15
  424. package/src/deps/jsr.io/@std/expect/1.0.14/_types.ts +0 -923
  425. package/src/deps/jsr.io/@std/expect/1.0.14/_utils.ts +0 -283
  426. package/src/deps/jsr.io/@std/expect/1.0.14/expect.ts +0 -620
  427. package/src/deps/jsr.io/@std/internal/1.0.6/assertion_state.ts +0 -215
  428. package/src/deps/jsr.io/@std/internal/1.0.6/build_message.ts +0 -134
  429. package/src/deps/jsr.io/@std/internal/1.0.6/diff.ts +0 -317
  430. package/src/deps/jsr.io/@std/internal/1.0.6/diff_str.ts +0 -208
  431. package/src/deps/jsr.io/@std/internal/1.0.6/format.ts +0 -39
  432. package/src/deps/jsr.io/@std/internal/1.0.6/styles.ts +0 -233
  433. package/src/deps/jsr.io/@std/internal/1.0.6/types.ts +0 -19
  434. package/src/deps/jsr.io/@std/testing/1.0.10/_mock_utils.ts +0 -43
  435. package/src/deps/jsr.io/@std/testing/1.0.10/_test_suite.ts +0 -448
  436. package/src/deps/jsr.io/@std/testing/1.0.10/bdd.ts +0 -1288
  437. package/src/deps/jsr.io/@std/testing/1.0.10/mock.ts +0 -1807
  438. package/src/mod.ts +0 -8
  439. package/src/src/assets.ts +0 -9
  440. package/src/src/ast/_index.ts +0 -66
  441. package/src/src/ast/common.ts +0 -1
  442. package/src/src/ast/index.ts +0 -1
  443. package/src/src/ast/node.ts +0 -10
  444. package/src/src/ast/nodes/annotation.test.ts +0 -69
  445. package/src/src/ast/nodes/annotation.ts +0 -79
  446. package/src/src/ast/nodes/argument.test.ts +0 -41
  447. package/src/src/ast/nodes/argument.ts +0 -62
  448. package/src/src/ast/nodes/call.test.ts +0 -44
  449. package/src/src/ast/nodes/call.ts +0 -66
  450. package/src/src/ast/nodes/class.test.ts +0 -274
  451. package/src/src/ast/nodes/class.ts +0 -178
  452. package/src/src/ast/nodes/collection-literal.ts +0 -49
  453. package/src/src/ast/nodes/constructor.test.ts +0 -178
  454. package/src/src/ast/nodes/constructor.ts +0 -126
  455. package/src/src/ast/nodes/doc-tag.test.ts +0 -84
  456. package/src/src/ast/nodes/doc-tag.ts +0 -138
  457. package/src/src/ast/nodes/doc.test.ts +0 -42
  458. package/src/src/ast/nodes/doc.ts +0 -111
  459. package/src/src/ast/nodes/enum-value.test.ts +0 -146
  460. package/src/src/ast/nodes/enum-value.ts +0 -100
  461. package/src/src/ast/nodes/enum.test.ts +0 -167
  462. package/src/src/ast/nodes/enum.ts +0 -163
  463. package/src/src/ast/nodes/function.test.ts +0 -194
  464. package/src/src/ast/nodes/function.ts +0 -178
  465. package/src/src/ast/nodes/generic-parameter.test.ts +0 -60
  466. package/src/src/ast/nodes/generic-parameter.ts +0 -54
  467. package/src/src/ast/nodes/init-block.test.ts +0 -36
  468. package/src/src/ast/nodes/init-block.ts +0 -38
  469. package/src/src/ast/nodes/interface.test.ts +0 -151
  470. package/src/src/ast/nodes/interface.ts +0 -133
  471. package/src/src/ast/nodes/lambda-type.ts +0 -68
  472. package/src/src/ast/nodes/lambda.ts +0 -68
  473. package/src/src/ast/nodes/object.test.ts +0 -101
  474. package/src/src/ast/nodes/object.ts +0 -102
  475. package/src/src/ast/nodes/parameter.test.ts +0 -191
  476. package/src/src/ast/nodes/parameter.ts +0 -118
  477. package/src/src/ast/nodes/property.test.ts +0 -253
  478. package/src/src/ast/nodes/property.ts +0 -225
  479. package/src/src/ast/nodes/reference.test.ts +0 -47
  480. package/src/src/ast/nodes/reference.ts +0 -178
  481. package/src/src/ast/nodes/string.test.ts +0 -61
  482. package/src/src/ast/nodes/string.ts +0 -114
  483. package/src/src/ast/nodes/types.ts +0 -23
  484. package/src/src/ast/references/index.ts +0 -8
  485. package/src/src/ast/references/jackson.ts +0 -16
  486. package/src/src/ast/references/jakarta.ts +0 -14
  487. package/src/src/ast/references/java.ts +0 -19
  488. package/src/src/ast/references/kotlin.ts +0 -41
  489. package/src/src/ast/references/okhttp3.ts +0 -5
  490. package/src/src/ast/references/reactor.ts +0 -5
  491. package/src/src/ast/references/spring.ts +0 -72
  492. package/src/src/ast/references/swagger.ts +0 -23
  493. package/src/src/ast/utils/get-kotlin-builder-options.ts +0 -19
  494. package/src/src/ast/utils/to-kt-node.ts +0 -31
  495. package/src/src/ast/utils/write-kt-annotations.ts +0 -15
  496. package/src/src/ast/utils/write-kt-arguments.ts +0 -45
  497. package/src/src/ast/utils/write-kt-enum-values.ts +0 -27
  498. package/src/src/ast/utils/write-kt-generic-parameters.ts +0 -12
  499. package/src/src/ast/utils/write-kt-members.ts +0 -25
  500. package/src/src/ast/utils/write-kt-node.ts +0 -37
  501. package/src/src/ast/utils/write-kt-parameters.ts +0 -25
  502. package/src/src/common-results.ts +0 -4
  503. package/src/src/config.ts +0 -41
  504. package/src/src/file-builder.ts +0 -108
  505. package/src/src/generators/file-generator.ts +0 -29
  506. package/src/src/generators/index.ts +0 -4
  507. package/src/src/generators/models/args.ts +0 -123
  508. package/src/src/generators/models/index.ts +0 -4
  509. package/src/src/generators/models/model-generator.ts +0 -653
  510. package/src/src/generators/models/models-generator.ts +0 -65
  511. package/src/src/generators/models/models.ts +0 -95
  512. package/src/src/generators/services/okhttp3-clients/args.ts +0 -78
  513. package/src/src/generators/services/okhttp3-clients/index.ts +0 -4
  514. package/src/src/generators/services/okhttp3-clients/models.ts +0 -62
  515. package/src/src/generators/services/okhttp3-clients/okhttp3-client-generator.ts +0 -567
  516. package/src/src/generators/services/okhttp3-clients/okhttp3-clients-generator.ts +0 -130
  517. package/src/src/generators/services/okhttp3-clients/refs.ts +0 -55
  518. package/src/src/generators/services/spring-controllers/args.ts +0 -88
  519. package/src/src/generators/services/spring-controllers/index.ts +0 -4
  520. package/src/src/generators/services/spring-controllers/models.ts +0 -71
  521. package/src/src/generators/services/spring-controllers/refs.ts +0 -17
  522. package/src/src/generators/services/spring-controllers/spring-controller-generator.ts +0 -782
  523. package/src/src/generators/services/spring-controllers/spring-controllers-generator.ts +0 -118
  524. package/src/src/import-collection.test.ts +0 -116
  525. package/src/src/import-collection.ts +0 -98
  526. package/src/src/types.ts +0 -3
  527. package/src/src/utils.ts +0 -39
  528. package/src/tests/openapi-models.test.ts +0 -63
  529. package/test_runner.js +0 -227
@@ -1,653 +0,0 @@
1
- import { dirname } from 'node:path';
2
-
3
-
4
- import fs from 'fs-extra';
5
-
6
- import {
7
- type ApiSchema,
8
- type ApiSchemaKind,
9
- type ApiSchemaProperty,
10
- type AppendValue,
11
- type AppendValueGroup,
12
- appendValueGroup,
13
- builderTemplate as s,
14
- createOverwriteProxy,
15
- getSchemaReference,
16
- type MaybePromise,
17
- modify,
18
- modifyEach,
19
- notNullish,
20
- resolveAnyOfAndAllOf,
21
- type SourceBuilder,
22
- toCasing,
23
- } from '@goast/core';
24
-
25
- import { kt } from '../../ast/index.js';
26
- import { KotlinFileBuilder } from '../../file-builder.js';
27
- import { KotlinFileGenerator } from '../file-generator.js';
28
- import type { DefaultKotlinModelGeneratorArgs as Args } from './index.js';
29
- import type { KotlinModelGeneratorContext, KotlinModelGeneratorOutput } from './models.js';
30
-
31
- type Context = KotlinModelGeneratorContext;
32
- type Output = KotlinModelGeneratorOutput;
33
- type Builder = KotlinFileBuilder;
34
-
35
- export interface KotlinModelGenerator<TOutput extends Output = Output> {
36
- generate(ctx: Context): MaybePromise<TOutput>;
37
- }
38
-
39
- export class DefaultKotlinModelGenerator extends KotlinFileGenerator<Context, Output> implements KotlinModelGenerator {
40
- public generate(ctx: Context): MaybePromise<KotlinModelGeneratorOutput> {
41
- if (/\/(anyOf|allOf)(\/[0-9]+)?$/.test(ctx.schema.$src.path)) {
42
- // Do not generate types that are only used for anyOf and/or allOf
43
- return { type: kt.refs.any({ nullable: true }) };
44
- }
45
-
46
- if (this.shouldGenerateTypeDeclaration(ctx, { schema: ctx.schema })) {
47
- const typeName = this.getDeclarationTypeName(ctx, { schema: ctx.schema });
48
- const packageName = this.getPackageName(ctx, { schema: ctx.schema });
49
- const filePath = `${ctx.config.outputDir}/${packageName.replace(/\./g, '/')}/${typeName}.kt`;
50
- console.log(`Generating model ${packageName}.${typeName} to ${filePath}...`);
51
- fs.ensureDirSync(dirname(filePath));
52
-
53
- fs.writeFileSync(
54
- filePath,
55
- new KotlinFileBuilder(packageName, ctx.config).append(this.getFileContent(ctx, {})).toString(),
56
- );
57
-
58
- return { type: kt.reference(typeName, packageName) };
59
- } else {
60
- return { type: this.getType(ctx, { schema: ctx.schema }) };
61
- }
62
- }
63
-
64
- protected getFileContent(ctx: Context, _args: Args.GetFileContent): AppendValueGroup<Builder> {
65
- return appendValueGroup<Builder>(
66
- [this.getSchemaDeclaration(ctx, { schema: this.normalizeSchema(ctx, { schema: ctx.schema }) })],
67
- '\n\n',
68
- );
69
- }
70
-
71
- protected getSchemaDeclaration(ctx: Context, args: Args.GetSchemaDeclaration): AppendValue<Builder> {
72
- const { schema } = args;
73
-
74
- if (schema.kind === 'object') {
75
- return schema.discriminator ? this.getInterface(ctx, { schema }) : this.getClass(ctx, { schema });
76
- } else if (schema.enum !== undefined && schema.enum.length > 0) {
77
- return this.getEnum(ctx, { schema });
78
- }
79
-
80
- return '// The generator was not able to generate this schema.\n// This should not happend. If you see this comment, please open an Issue on Github.';
81
- }
82
-
83
- protected getClass(ctx: Context, args: Args.GetClass): kt.Class<Builder> {
84
- const { schema } = args;
85
- const inheritedSchemas = this.getInheritedSchemas(ctx, { schema });
86
- const parameters = this.getClassProperties(ctx, { schema });
87
-
88
- return kt.class(this.getDeclarationTypeName(ctx, { schema }), {
89
- doc: kt.doc(schema.description?.trim()),
90
- annotations: [schema.deprecated ? kt.annotation(kt.refs.deprecated(), [kt.argument(kt.string(''))]) : null],
91
- classKind: parameters.length === 0 ? null : 'data',
92
- implements: inheritedSchemas.map((schema) => this.getType(ctx, { schema })),
93
- primaryConstructor: kt.constructor(
94
- parameters.map((property) => this.getClassParameter(ctx, { ...args, inheritedSchemas, parameters, property })),
95
- ),
96
- members: [
97
- ...(schema.additionalProperties !== undefined && schema.additionalProperties !== false
98
- ? [
99
- this.getAdditionalPropertiesProperty(ctx, { schema }),
100
- this.getAdditionalPropertiesSetter(ctx, { schema }),
101
- this.getAdditionalPropertiesGetter(ctx, { schema }),
102
- ]
103
- : []),
104
- ],
105
- });
106
- }
107
-
108
- protected getInterface(ctx: Context, args: Args.GetInterface): kt.Interface<Builder> {
109
- const { schema } = args;
110
-
111
- return kt.interface(this.getDeclarationTypeName(ctx, { schema }), {
112
- doc: kt.doc(schema.description?.trim()),
113
- annotations: [
114
- this.getJacksonJsonTypeInfoAnnotation(ctx, { schema }),
115
- this.getJacksonJsonSubTypesAnnotation(ctx, { schema }),
116
- schema.deprecated ? kt.annotation(kt.refs.deprecated(), [kt.argument(kt.string(''))]) : null,
117
- ].filter(notNullish),
118
- members: this.sortProperties(ctx, { schema, properties: schema.properties.values() }).map((property) =>
119
- this.getInterfaceProperty(ctx, { schema, property })
120
- ),
121
- });
122
- }
123
-
124
- protected getEnum(ctx: Context, args: Args.GetEnum): kt.Enum<Builder> {
125
- const { schema } = args;
126
-
127
- const name = this.getDeclarationTypeName(ctx, { schema });
128
- return kt.enum(
129
- name,
130
- schema.enum?.map((x) =>
131
- kt.enumValue(toCasing(String(x), ctx.config.enumValueNameCasing), {
132
- annotations: [kt.annotation(kt.refs.jackson.jsonProperty(), [kt.argument(kt.string(String(x)))])],
133
- arguments: [kt.argument(kt.string(String(x)))],
134
- })
135
- ) ?? [],
136
- {
137
- doc: kt.doc(schema.description?.trim()),
138
- annotations: [schema.deprecated ? kt.annotation(kt.refs.deprecated(), [kt.argument(kt.string(''))]) : null],
139
- primaryConstructor: kt.constructor([
140
- kt.parameter.class(toCasing('value', ctx.config.propertyNameCasing), kt.refs.string(), {
141
- property: 'readonly',
142
- }),
143
- ]),
144
- companionObject: kt.object({
145
- members: [
146
- kt.function('fromValue', {
147
- parameters: [kt.parameter('value', kt.refs.string())],
148
- returnType: kt.reference(name, null, { nullable: true }),
149
- singleExpression: true,
150
- body: !schema.enum?.length ? 'null' : s`\nwhen(value) {${s.indent`${
151
- appendValueGroup([
152
- schema.enum.map((x) =>
153
- s`\n${kt.string(String(x))} -> ${toCasing(String(x), ctx.config.enumValueNameCasing)}`
154
- ),
155
- ])
156
- }
157
- else -> null`}
158
- }`,
159
- }),
160
- ],
161
- }),
162
- },
163
- );
164
- }
165
-
166
- protected getType(ctx: Context, args: Args.GetType): kt.Reference<SourceBuilder> {
167
- const { schema } = args;
168
-
169
- const generatedType = this.getGeneratedType(ctx, { schema, nullable: args.nullable });
170
- if (generatedType) {
171
- return generatedType;
172
- }
173
-
174
- const nullable = args.nullable ?? schema.nullable;
175
- switch (schema.kind) {
176
- case 'boolean':
177
- return kt.refs.boolean({ nullable });
178
- case 'integer':
179
- case 'number':
180
- switch (schema.format) {
181
- case 'int32':
182
- return kt.refs.int({ nullable });
183
- case 'int64':
184
- return kt.refs.long({ nullable });
185
- case 'float':
186
- return kt.refs.float({ nullable });
187
- case 'double':
188
- return kt.refs.double({ nullable });
189
- default:
190
- return schema.kind === 'integer' ? kt.refs.int({ nullable }) : kt.refs.double({ nullable });
191
- }
192
- case 'string':
193
- switch (schema.format) {
194
- case 'date-time':
195
- return kt.refs.java.offsetDateTime({ nullable });
196
- default:
197
- return kt.refs.string({ nullable });
198
- }
199
- case 'null':
200
- return kt.refs.nothing({ nullable });
201
- case 'unknown':
202
- return kt.refs.any({ nullable });
203
- case 'array':
204
- return kt.refs.list(
205
- [schema.items ? this.getType(ctx, { schema: schema.items }) : kt.refs.any({ nullable: true })],
206
- { nullable },
207
- );
208
- case 'object':
209
- return schema.properties.size === 0 && schema.additionalProperties
210
- ? kt.refs.map([kt.refs.string(), this.getAdditionalPropertiesType(ctx, { schema })], { nullable })
211
- : kt.refs.any({ nullable });
212
- default:
213
- return kt.refs.any({ nullable });
214
- }
215
- }
216
-
217
- protected getGeneratedType(ctx: Context, args: Args.GetGeneratedType): kt.Reference<SourceBuilder> | null {
218
- const schema = getSchemaReference(args.schema, ['description']);
219
- if (this.shouldGenerateTypeDeclaration(ctx, { schema })) {
220
- return kt.reference(this.getDeclarationTypeName(ctx, { schema }), this.getPackageName(ctx, { schema }), {
221
- nullable: args.nullable ?? schema.nullable,
222
- });
223
- }
224
- return null;
225
- }
226
-
227
- protected getAdditionalPropertiesType(
228
- ctx: Context,
229
- args: Args.GetAdditionalPropertiesType,
230
- ): kt.Reference<SourceBuilder> {
231
- const { schema } = args;
232
-
233
- return typeof schema.additionalProperties === 'object'
234
- ? this.getType(ctx, { schema: schema.additionalProperties })
235
- : kt.refs.any({ nullable: true });
236
- }
237
-
238
- protected getDefaultValue(ctx: Context, args: Args.GetDefaultValue): kt.Value<Builder> {
239
- const { schema } = args;
240
-
241
- if (schema.default === null || schema.default === undefined) {
242
- return 'null';
243
- } else {
244
- switch (schema.kind) {
245
- case 'boolean':
246
- return Boolean(schema.default) || String(schema.default).toLowerCase() === 'true' ? 'true' : 'false';
247
- case 'integer':
248
- case 'number':
249
- return String(schema.default);
250
- case 'string':
251
- return schema.enum && schema.enum.length > 0
252
- ? kt.call([this.getType(ctx, { schema }), toCasing(String(schema.default), ctx.config.enumValueNameCasing)])
253
- : kt.string(String(schema.default));
254
- case 'array':
255
- return kt.call(
256
- kt.refs.listOf.infer(),
257
- Array.isArray(schema.default) ? schema.default.map((x) => kt.toNode(x)) : [],
258
- );
259
- default:
260
- return 'null';
261
- }
262
- }
263
- }
264
-
265
- // #region Members
266
- protected getClassParameter(ctx: Context, args: Args.GetClassParameter): kt.Parameter<Builder> {
267
- const { schema, inheritedSchemas, property } = args;
268
-
269
- return kt.parameter.class(
270
- toCasing(property.name, ctx.config.propertyNameCasing),
271
- this.getType(ctx, { schema: property.schema, nullable: schema.required.has(property.name) ? undefined : true }),
272
- {
273
- description: property.schema.description?.trim(),
274
- annotations: [
275
- ...this.getJakartaValidationAnnotations(ctx, { schema, property }),
276
- this.getSwaggerSchemaAnnotation(ctx, { schema, property }),
277
- this.getJacksonJsonPropertyAnnotation(ctx, { schema, property }),
278
- modify(this.getJacksonJsonIncludeAnnotation(ctx, { schema, property }), (x) => (x.target = 'get')),
279
- property.schema.deprecated ? kt.annotation(kt.refs.deprecated(), [kt.argument(kt.string(''))]) : null,
280
- ].filter(notNullish),
281
- override: inheritedSchemas.some((schema) => this.hasProperty(ctx, { schema, propertyName: property.name })),
282
- property: 'readonly',
283
- default: property.schema.default !== undefined || !schema.required.has(property.name)
284
- ? this.getDefaultValue(ctx, { schema: property.schema })
285
- : null,
286
- },
287
- );
288
- }
289
-
290
- protected getInterfaceProperty(ctx: Context, args: Args.GetInterfaceProperty): kt.Property<Builder> {
291
- const { schema, property } = args;
292
-
293
- return kt.property(toCasing(property.name, ctx.config.propertyNameCasing), {
294
- doc: kt.doc(property.schema.description?.trim()),
295
- annotations: modifyEach(
296
- [
297
- this.getJacksonJsonPropertyAnnotation(ctx, { schema, property }),
298
- this.getJacksonJsonIncludeAnnotation(ctx, { schema, property }),
299
- property.schema.deprecated ? kt.annotation(kt.refs.deprecated(), [kt.argument(kt.string(''))]) : null,
300
- ].filter(notNullish),
301
- (x) => (x.target = 'get'),
302
- ),
303
- type: this.getType(ctx, {
304
- schema: property.schema,
305
- nullable: schema.required.has(property.name) ? undefined : true,
306
- }),
307
- });
308
- }
309
-
310
- protected getAdditionalPropertiesProperty(
311
- ctx: Context,
312
- args: Args.GetAdditionalPropertiesProperty,
313
- ): kt.Property<Builder> {
314
- const { schema } = args;
315
-
316
- return kt.property(toCasing('additionalProperties', ctx.config.propertyNameCasing), {
317
- annotations: [kt.annotation(kt.refs.jackson.jsonIgnore())],
318
- type: kt.reference('MutableMap', null, {
319
- generics: ['String', this.getAdditionalPropertiesType(ctx, { schema })],
320
- }),
321
- default: 'mutableMapOf()',
322
- });
323
- }
324
-
325
- protected getAdditionalPropertiesSetter(
326
- ctx: Context,
327
- args: Args.GetAdditionalPropertiesSetter,
328
- ): kt.Function<Builder> {
329
- const { schema } = args;
330
-
331
- return kt.function(toCasing('set', ctx.config.functionNameCasing), {
332
- annotations: [kt.annotation(kt.refs.jackson.jsonAnySetter())],
333
- parameters: [
334
- kt.parameter(toCasing('name', ctx.config.parameterNameCasing), 'String'),
335
- kt.parameter(
336
- toCasing('value', ctx.config.parameterNameCasing),
337
- this.getAdditionalPropertiesType(ctx, { schema }),
338
- ),
339
- ],
340
- body: `this.${toCasing('additionalProperties', ctx.config.propertyNameCasing)}[name] = value`,
341
- });
342
- }
343
-
344
- protected getAdditionalPropertiesGetter(
345
- ctx: Context,
346
- args: Args.GetAdditionalPropertiesGetter,
347
- ): kt.Function<Builder> {
348
- const { schema } = args;
349
-
350
- return kt.function(toCasing('getMap', ctx.config.functionNameCasing), {
351
- annotations: [kt.annotation(kt.refs.jackson.jsonAnyGetter())],
352
- returnType: kt.refs.map([kt.refs.string(), this.getAdditionalPropertiesType(ctx, { schema })]),
353
- body: `return this.${toCasing('additionalProperties', ctx.config.propertyNameCasing)}`,
354
- });
355
- }
356
- // #endregion
357
-
358
- // #region Annotations
359
- protected getJacksonJsonTypeInfoAnnotation(
360
- ctx: Context,
361
- args: Args.GetJacksonJsonTypeInfoAnnotation,
362
- ): kt.Annotation<Builder> | null {
363
- const { schema } = args;
364
-
365
- return ctx.config.addJacksonAnnotations && schema.discriminator
366
- ? kt.annotation(kt.refs.jackson.jsonTypeInfo(), [
367
- kt.argument.named('use', 'JsonTypeInfo.Id.NAME'),
368
- kt.argument.named(
369
- 'include',
370
- 'properties' in schema && schema.properties.has(schema.discriminator.propertyName)
371
- ? 'JsonTypeInfo.As.EXISTING_PROPERTY'
372
- : 'JsonTypeInfo.As.PROPERTY',
373
- ),
374
- kt.argument.named('property', kt.string(schema.discriminator.propertyName)),
375
- kt.argument.named('visible', 'true'),
376
- ])
377
- : null;
378
- }
379
-
380
- protected getJacksonJsonSubTypesAnnotation(
381
- ctx: Context,
382
- args: Args.GetJacksonJsonSubTypesAnnotation,
383
- ): kt.Annotation<Builder> | null {
384
- const { schema } = args;
385
-
386
- if (!ctx.config.addJacksonAnnotations || !schema.discriminator) return null;
387
- const entries = Object.entries(schema.discriminator.mapping);
388
- return entries.length > 0
389
- ? kt.annotation(
390
- kt.refs.jackson.jsonSubTypes(),
391
- entries.map(([value, schema]) =>
392
- kt.argument(
393
- kt.call(
394
- [kt.refs.jackson.jsonSubTypes(), 'Type'],
395
- [
396
- kt.argument.named(
397
- 'value',
398
- modify(this.getType(ctx, { schema }), (x) => (x.classReference = true)),
399
- ),
400
- kt.argument.named('name', kt.string(value)),
401
- ],
402
- ),
403
- )
404
- ),
405
- )
406
- : null;
407
- }
408
-
409
- protected getJacksonJsonPropertyAnnotation(
410
- ctx: Context,
411
- args: Args.GetJacksonJsonPropertyAnnotation,
412
- ): kt.Annotation<Builder> | null {
413
- const { schema, property } = args;
414
-
415
- return ctx.config.addJacksonAnnotations
416
- ? kt.annotation(kt.refs.jackson.jsonProperty(), [
417
- kt.argument(kt.string(property.name)),
418
- schema.required.has(property.name) ? kt.argument.named('required', 'true') : null,
419
- ])
420
- : null;
421
- }
422
-
423
- protected getJacksonJsonIncludeAnnotation(
424
- ctx: Context,
425
- args: Args.GetJacksonJsonIncludeAnnotation,
426
- ): kt.Annotation<Builder> | null {
427
- const { property } = args;
428
-
429
- return ctx.config.addJacksonAnnotations && property.schema.custom['exclude-when-null'] === true
430
- ? kt.annotation(kt.refs.jackson.jsonInclude(), [
431
- kt.argument(kt.call([kt.refs.jackson.jsonInclude(), 'Include', 'NON_NULL'])),
432
- ])
433
- : null;
434
- }
435
-
436
- protected getJakartaValidationAnnotations(
437
- ctx: Context,
438
- args: Args.GetJakartaValidationAnnotations,
439
- ): kt.Annotation<Builder>[] {
440
- const { property } = args;
441
- const annotations: kt.Annotation<Builder>[] = [];
442
- if (!ctx.config.addJakartaValidationAnnotations) {
443
- return annotations;
444
- }
445
-
446
- if (property.schema.kind === 'string') {
447
- if (property.schema.pattern) {
448
- annotations.push(
449
- kt.annotation(kt.refs.jakarta.pattern(), [kt.argument.named('regexp', kt.string(property.schema.pattern))], {
450
- target: 'get',
451
- }),
452
- );
453
- }
454
- if (property.schema.minLength === 1 && property.schema.maxLength === undefined) {
455
- annotations.push(kt.annotation(kt.refs.jakarta.notEmpty(), [], { target: 'get' }));
456
- } else if (property.schema.minLength !== undefined || property.schema.maxLength !== undefined) {
457
- annotations.push(kt.annotation(kt.refs.jakarta.size(), [
458
- property.schema.minLength !== undefined ? kt.argument.named('min', property.schema.minLength) : null,
459
- property.schema.maxLength !== undefined ? kt.argument.named('max', property.schema.maxLength) : null,
460
- ], { target: 'get' }));
461
- }
462
- } else if (property.schema.kind === 'number' || property.schema.kind === 'integer') {
463
- if (property.schema.minimum !== undefined) {
464
- annotations.push(
465
- kt.annotation(kt.refs.jakarta.min(), [kt.argument.named('value', property.schema.minimum)], {
466
- target: 'get',
467
- }),
468
- );
469
- }
470
- if (property.schema.maximum !== undefined) {
471
- annotations.push(
472
- kt.annotation(kt.refs.jakarta.max(), [kt.argument.named('value', property.schema.maximum)], {
473
- target: 'get',
474
- }),
475
- );
476
- }
477
- } else if (property.schema.kind === 'array') {
478
- if (property.schema.minItems !== undefined || property.schema.maxItems !== undefined) {
479
- annotations.push(kt.annotation(kt.refs.jakarta.size(), [
480
- property.schema.minItems !== undefined ? kt.argument.named('min', property.schema.minItems) : null,
481
- property.schema.maxItems !== undefined ? kt.argument.named('max', property.schema.maxItems) : null,
482
- ], { target: 'get' }));
483
- }
484
- }
485
-
486
- if (this.shouldGenerateTypeDeclaration(ctx, { schema: property.schema })) {
487
- annotations.push(kt.annotation(kt.refs.jakarta.valid(), [], { target: 'field' }));
488
- }
489
-
490
- return annotations;
491
- }
492
-
493
- protected getSwaggerSchemaAnnotation(
494
- ctx: Context,
495
- args: Args.GetSwaggerSchemaAnnotation,
496
- ): kt.Annotation<Builder> | null {
497
- const { schema, property } = args;
498
-
499
- return ctx.config.addSwaggerAnnotations
500
- ? kt.annotation(kt.refs.swagger.schema(), [
501
- property.schema.example !== undefined
502
- ? kt.argument.named('example', kt.string(String(property.schema.example)))
503
- : null,
504
- schema.required.has(property.name) ? kt.argument.named('required', 'true') : null,
505
- property.schema.description !== undefined
506
- ? kt.argument.named('description', kt.string(property.schema.description))
507
- : null,
508
- property.schema.deprecated ? kt.argument.named('deprecated', kt.toNode(property.schema.deprecated)) : null,
509
- ])
510
- : null;
511
- }
512
- // #endregion
513
-
514
- protected getPackageName(ctx: Context, args: Args.GetPackageName): string {
515
- const { schema } = args;
516
-
517
- const packageSuffix = typeof ctx.config.packageSuffix === 'string'
518
- ? ctx.config.packageSuffix
519
- : ctx.config.packageSuffix(schema);
520
- return ctx.config.packageName + packageSuffix;
521
- }
522
-
523
- protected shouldGenerateTypeDeclaration(ctx: Context, args: Args.ShouldGenerateTypeDeclaration): boolean {
524
- let { schema } = args;
525
-
526
- // All enum types should have its own type declaration
527
- if (schema.enum !== undefined && schema.enum.length > 0) {
528
- return true;
529
- }
530
-
531
- // All primitive types already exist and do not need its own type declaration
532
- if (
533
- schema.kind !== 'combined' &&
534
- schema.kind !== 'multi-type' &&
535
- schema.kind !== 'object' &&
536
- schema.kind !== 'oneOf'
537
- ) {
538
- return false;
539
- }
540
-
541
- // Too complex types cannot be represented in Kotlin, so they fallback to Any
542
- if (schema.kind === 'multi-type') {
543
- return false;
544
- }
545
- schema = this.normalizeSchema(ctx, { schema });
546
- if (schema.kind === 'combined' || schema.kind === 'oneOf') {
547
- return false;
548
- }
549
-
550
- // Schemas representable by a simple Map type do not need its own type declaration
551
- if (schema.kind === 'object' && schema.properties.size === 0 && schema.additionalProperties) {
552
- return false;
553
- }
554
-
555
- if (schema.kind === 'object' && ctx.config.emptyObjectTypeBehavior === 'use-any' && schema.properties.size === 0) {
556
- return false;
557
- }
558
-
559
- // Dynamically generated schemas do not have its own type declaration
560
- if (!ctx.data.schemas.some((x) => x.id === schema.id)) {
561
- return false;
562
- }
563
-
564
- // multipart schemas should not have its own type declaration
565
- if (schema.$src.path.endsWith('/requestBody/content/multipart/form-data/schema')) {
566
- return false;
567
- }
568
-
569
- return true;
570
- }
571
-
572
- protected getDeclarationTypeName(ctx: Context, args: Args.GetDeclarationTypeName): string {
573
- return toCasing(args.schema.name, ctx.config.typeNameCasing);
574
- }
575
-
576
- protected getInheritedSchemas(
577
- ctx: Context,
578
- args: Args.GetInheritedSchemas,
579
- ): (ApiSchema<ApiSchemaKind> & { discriminator: NonNullable<ApiSchema['discriminator']> })[] {
580
- return args.schema.inheritedSchemas
581
- .filter((schema) => this.shouldGenerateTypeDeclaration(ctx, { schema }) && !schema.isNameGenerated)
582
- .filter((item, index, self) => self.indexOf(item) === index);
583
- }
584
-
585
- protected getClassProperties(ctx: Context, args: Args.GetClassProperties): ApiSchemaProperty[] {
586
- const { schema } = args;
587
-
588
- const inheritedSchemas = this.getInheritedSchemas(ctx, { schema });
589
- const properties: ApiSchemaProperty[] = [];
590
- const appendedProperties: ApiSchemaProperty[] = [];
591
- for (const property of schema.properties.values()) {
592
- const discriminator = inheritedSchemas.find(
593
- (x) => x.discriminator?.propertyName === property.name,
594
- )?.discriminator;
595
- if (discriminator) {
596
- const schemaMappings = Object.entries(discriminator.mapping).filter(([_, v]) => v.id === schema.id);
597
- if (schemaMappings.length === 1) {
598
- const p = createOverwriteProxy(property);
599
- const s = createOverwriteProxy(p.schema);
600
- p.schema = s;
601
- s.default = schemaMappings[0][0];
602
- appendedProperties.push(p);
603
- continue;
604
- }
605
- }
606
-
607
- properties.push(property);
608
- }
609
-
610
- return [...this.sortProperties(ctx, { schema, properties }), ...appendedProperties];
611
- }
612
-
613
- protected sortProperties(_ctx: Context, args: Args.SortProperties): ApiSchemaProperty[] {
614
- return [...args.properties].sort((a, b) => classify(a) - classify(b));
615
-
616
- function classify(p: ApiSchemaProperty) {
617
- if (p.schema.default !== undefined) return 1;
618
- if (args.schema.required.has(p.name)) return 0;
619
- return 2;
620
- }
621
- }
622
-
623
- protected normalizeSchema(ctx: Context, args: Args.NormalizeSchema): ApiSchema {
624
- let { schema } = args;
625
-
626
- if (schema.kind === 'oneOf') {
627
- schema = ctx.config.oneOfBehavior === 'treat-as-any-of'
628
- // deno-lint-ignore no-explicit-any
629
- ? { ...(schema as any), kind: 'combined', anyOf: schema.oneOf, allOf: [], oneOf: undefined }
630
- // deno-lint-ignore no-explicit-any
631
- : { ...(schema as any), kind: 'combined', allOf: schema.oneOf, anyOf: [], oneOf: undefined };
632
- ctx.schema = schema;
633
- }
634
- if (schema.kind === 'object' || schema.kind === 'combined') {
635
- const mergedSchema = resolveAnyOfAndAllOf(schema, true);
636
- if (mergedSchema) {
637
- schema = mergedSchema;
638
- }
639
- }
640
-
641
- return schema;
642
- }
643
-
644
- protected hasProperty(ctx: Context, args: Args.HasProperty): boolean {
645
- const { schema, propertyName } = args;
646
-
647
- return (
648
- ('properties' in schema && schema.properties.has(propertyName)) ||
649
- ('anyOf' in schema && schema.anyOf.some((schema) => this.hasProperty(ctx, { schema, propertyName }))) ||
650
- ('allOf' in schema && schema.allOf.some((schema) => this.hasProperty(ctx, { schema, propertyName })))
651
- );
652
- }
653
- }