@skmtc/core 0.0.940 → 0.0.941

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 (255) hide show
  1. package/esm/context/CoreContext.d.ts +6 -32
  2. package/esm/context/CoreContext.d.ts.map +1 -1
  3. package/esm/context/CoreContext.js +15 -60
  4. package/esm/context/GenerateContext.d.ts +4 -15
  5. package/esm/context/GenerateContext.d.ts.map +1 -1
  6. package/esm/context/GenerateContext.js +16 -35
  7. package/esm/context/ParseContext.d.ts +5 -9
  8. package/esm/context/ParseContext.d.ts.map +1 -1
  9. package/esm/context/ParseContext.js +11 -18
  10. package/esm/context/RenderContext.d.ts +6 -209
  11. package/esm/context/RenderContext.d.ts.map +1 -1
  12. package/esm/context/RenderContext.js +8 -215
  13. package/esm/context/ResultsHandler.d.ts +0 -67
  14. package/esm/context/ResultsHandler.d.ts.map +1 -1
  15. package/esm/context/ResultsHandler.js +2 -68
  16. package/esm/context/StackTrail.d.ts +2 -0
  17. package/esm/context/StackTrail.d.ts.map +1 -1
  18. package/esm/context/StackTrail.js +26 -0
  19. package/esm/context/generateTypes.d.ts +2 -2
  20. package/esm/context/generateTypes.d.ts.map +1 -1
  21. package/esm/context/parseTypes.d.ts +7 -2
  22. package/esm/context/parseTypes.d.ts.map +1 -1
  23. package/esm/oas/_helpers/parseEnum.d.ts +3 -1
  24. package/esm/oas/_helpers/parseEnum.d.ts.map +1 -1
  25. package/esm/oas/_helpers/parseEnum.js +2 -1
  26. package/esm/oas/_helpers/parseNullable.d.ts +4 -1
  27. package/esm/oas/_helpers/parseNullable.d.ts.map +1 -1
  28. package/esm/oas/_helpers/parseNullable.js +2 -1
  29. package/esm/oas/array/toArray.d.ts +5 -2
  30. package/esm/oas/array/toArray.d.ts.map +1 -1
  31. package/esm/oas/array/toArray.js +16 -9
  32. package/esm/oas/boolean/toBoolean.d.ts +5 -2
  33. package/esm/oas/boolean/toBoolean.d.ts.map +1 -1
  34. package/esm/oas/boolean/toBoolean.js +16 -8
  35. package/esm/oas/components/toComponentsV3.d.ts +3 -1
  36. package/esm/oas/components/toComponentsV3.d.ts.map +1 -1
  37. package/esm/oas/components/toComponentsV3.js +9 -8
  38. package/esm/oas/contact/toContactV3.d.ts +2 -1
  39. package/esm/oas/contact/toContactV3.d.ts.map +1 -1
  40. package/esm/oas/contact/toContactV3.js +2 -1
  41. package/esm/oas/discriminator/toDiscriminatorV3.d.ts +3 -1
  42. package/esm/oas/discriminator/toDiscriminatorV3.d.ts.map +1 -1
  43. package/esm/oas/discriminator/toDiscriminatorV3.js +7 -2
  44. package/esm/oas/document/toDocumentFieldsV3.d.ts +3 -1
  45. package/esm/oas/document/toDocumentFieldsV3.d.ts.map +1 -1
  46. package/esm/oas/document/toDocumentFieldsV3.js +10 -9
  47. package/esm/oas/example/toExamplesV3.d.ts +10 -2
  48. package/esm/oas/example/toExamplesV3.d.ts.map +1 -1
  49. package/esm/oas/example/toExamplesV3.js +8 -7
  50. package/esm/oas/externalDocs/toExternalDocs.d.ts +3 -1
  51. package/esm/oas/externalDocs/toExternalDocs.d.ts.map +1 -1
  52. package/esm/oas/externalDocs/toExternalDocs.js +1 -1
  53. package/esm/oas/header/toHeadersV3.d.ts +3 -1
  54. package/esm/oas/header/toHeadersV3.d.ts.map +1 -1
  55. package/esm/oas/header/toHeadersV3.js +8 -7
  56. package/esm/oas/info/toInfoV3.d.ts +3 -1
  57. package/esm/oas/info/toInfoV3.d.ts.map +1 -1
  58. package/esm/oas/info/toInfoV3.js +4 -3
  59. package/esm/oas/integer/toInteger.d.ts +5 -2
  60. package/esm/oas/integer/toInteger.d.ts.map +1 -1
  61. package/esm/oas/integer/toInteger.js +17 -9
  62. package/esm/oas/license/toLicenseV3.d.ts +2 -1
  63. package/esm/oas/license/toLicenseV3.d.ts.map +1 -1
  64. package/esm/oas/license/toLicenseV3.js +2 -1
  65. package/esm/oas/mediaType/toMediaTypeItemV3.d.ts +10 -3
  66. package/esm/oas/mediaType/toMediaTypeItemV3.d.ts.map +1 -1
  67. package/esm/oas/mediaType/toMediaTypeItemV3.js +9 -8
  68. package/esm/oas/number/toNumber.d.ts +3 -1
  69. package/esm/oas/number/toNumber.d.ts.map +1 -1
  70. package/esm/oas/number/toNumber.js +15 -7
  71. package/esm/oas/object/toAdditionalPropertiesV3.d.ts +3 -1
  72. package/esm/oas/object/toAdditionalPropertiesV3.d.ts.map +1 -1
  73. package/esm/oas/object/toAdditionalPropertiesV3.js +2 -2
  74. package/esm/oas/object/toObject.d.ts +3 -1
  75. package/esm/oas/object/toObject.d.ts.map +1 -1
  76. package/esm/oas/object/toObject.js +15 -9
  77. package/esm/oas/operation/toOperationsV3.d.ts +5 -2
  78. package/esm/oas/operation/toOperationsV3.d.ts.map +1 -1
  79. package/esm/oas/operation/toOperationsV3.js +14 -12
  80. package/esm/oas/parameter/toParameterV3.d.ts +7 -3
  81. package/esm/oas/parameter/toParameterV3.d.ts.map +1 -1
  82. package/esm/oas/parameter/toParameterV3.js +18 -16
  83. package/esm/oas/pathItem/toPathItemV3.d.ts +3 -1
  84. package/esm/oas/pathItem/toPathItemV3.d.ts.map +1 -1
  85. package/esm/oas/pathItem/toPathItemV3.js +3 -3
  86. package/esm/oas/ref/toRefV31.d.ts +3 -1
  87. package/esm/oas/ref/toRefV31.d.ts.map +1 -1
  88. package/esm/oas/ref/toRefV31.js +3 -3
  89. package/esm/oas/requestBody/toRequestBodiesV3.d.ts +5 -2
  90. package/esm/oas/requestBody/toRequestBodiesV3.d.ts.map +1 -1
  91. package/esm/oas/requestBody/toRequestBodiesV3.js +7 -7
  92. package/esm/oas/response/toResponseV3.d.ts +7 -3
  93. package/esm/oas/response/toResponseV3.d.ts.map +1 -1
  94. package/esm/oas/response/toResponseV3.js +10 -9
  95. package/esm/oas/schema/toSchemasV3.d.ts +9 -4
  96. package/esm/oas/schema/toSchemasV3.d.ts.map +1 -1
  97. package/esm/oas/schema/toSchemasV3.js +33 -25
  98. package/esm/oas/securityRequirement/toSecurityRequirement.d.ts +3 -1
  99. package/esm/oas/securityRequirement/toSecurityRequirement.d.ts.map +1 -1
  100. package/esm/oas/securityRequirement/toSecurityRequirement.js +1 -1
  101. package/esm/oas/securitySchemes/toSecuritySchemes.d.ts +3 -1
  102. package/esm/oas/securitySchemes/toSecuritySchemes.d.ts.map +1 -1
  103. package/esm/oas/securitySchemes/toSecuritySchemes.js +23 -8
  104. package/esm/oas/server/toServerV3.d.ts +7 -3
  105. package/esm/oas/server/toServerV3.d.ts.map +1 -1
  106. package/esm/oas/server/toServerV3.js +7 -7
  107. package/esm/oas/serverVariable/toServerVariableV3.d.ts +7 -3
  108. package/esm/oas/serverVariable/toServerVariableV3.d.ts.map +1 -1
  109. package/esm/oas/serverVariable/toServerVariableV3.js +6 -5
  110. package/esm/oas/specificationExtensions/toSpecificationExtensionsV3.d.ts +3 -1
  111. package/esm/oas/specificationExtensions/toSpecificationExtensionsV3.d.ts.map +1 -1
  112. package/esm/oas/specificationExtensions/toSpecificationExtensionsV3.js +2 -2
  113. package/esm/oas/string/toString.d.ts +6 -2
  114. package/esm/oas/string/toString.d.ts.map +1 -1
  115. package/esm/oas/string/toString.js +18 -9
  116. package/esm/oas/tag/toTagsV3.d.ts +5 -2
  117. package/esm/oas/tag/toTagsV3.d.ts.map +1 -1
  118. package/esm/oas/tag/toTagsV3.js +4 -3
  119. package/esm/oas/union/toUnion.d.ts +3 -1
  120. package/esm/oas/union/toUnion.d.ts.map +1 -1
  121. package/esm/oas/union/toUnion.js +4 -4
  122. package/esm/oas/unknown/toUnknown.d.ts +3 -1
  123. package/esm/oas/unknown/toUnknown.d.ts.map +1 -1
  124. package/esm/oas/unknown/toUnknown.js +2 -1
  125. package/esm/run/toArtifacts.d.ts +4 -1
  126. package/esm/run/toArtifacts.d.ts.map +1 -1
  127. package/esm/run/toArtifacts.js +2 -1
  128. package/package.json +1 -1
  129. package/script/context/CoreContext.d.ts +6 -32
  130. package/script/context/CoreContext.d.ts.map +1 -1
  131. package/script/context/CoreContext.js +15 -60
  132. package/script/context/GenerateContext.d.ts +4 -15
  133. package/script/context/GenerateContext.d.ts.map +1 -1
  134. package/script/context/GenerateContext.js +16 -35
  135. package/script/context/ParseContext.d.ts +5 -9
  136. package/script/context/ParseContext.d.ts.map +1 -1
  137. package/script/context/ParseContext.js +11 -18
  138. package/script/context/RenderContext.d.ts +6 -209
  139. package/script/context/RenderContext.d.ts.map +1 -1
  140. package/script/context/RenderContext.js +8 -215
  141. package/script/context/ResultsHandler.d.ts +0 -67
  142. package/script/context/ResultsHandler.d.ts.map +1 -1
  143. package/script/context/ResultsHandler.js +2 -68
  144. package/script/context/StackTrail.d.ts +2 -0
  145. package/script/context/StackTrail.d.ts.map +1 -1
  146. package/script/context/StackTrail.js +26 -0
  147. package/script/context/generateTypes.d.ts +2 -2
  148. package/script/context/generateTypes.d.ts.map +1 -1
  149. package/script/context/parseTypes.d.ts +7 -2
  150. package/script/context/parseTypes.d.ts.map +1 -1
  151. package/script/oas/_helpers/parseEnum.d.ts +3 -1
  152. package/script/oas/_helpers/parseEnum.d.ts.map +1 -1
  153. package/script/oas/_helpers/parseEnum.js +2 -1
  154. package/script/oas/_helpers/parseNullable.d.ts +4 -1
  155. package/script/oas/_helpers/parseNullable.d.ts.map +1 -1
  156. package/script/oas/_helpers/parseNullable.js +2 -1
  157. package/script/oas/array/toArray.d.ts +5 -2
  158. package/script/oas/array/toArray.d.ts.map +1 -1
  159. package/script/oas/array/toArray.js +16 -9
  160. package/script/oas/boolean/toBoolean.d.ts +5 -2
  161. package/script/oas/boolean/toBoolean.d.ts.map +1 -1
  162. package/script/oas/boolean/toBoolean.js +16 -8
  163. package/script/oas/components/toComponentsV3.d.ts +3 -1
  164. package/script/oas/components/toComponentsV3.d.ts.map +1 -1
  165. package/script/oas/components/toComponentsV3.js +9 -8
  166. package/script/oas/contact/toContactV3.d.ts +2 -1
  167. package/script/oas/contact/toContactV3.d.ts.map +1 -1
  168. package/script/oas/contact/toContactV3.js +2 -1
  169. package/script/oas/discriminator/toDiscriminatorV3.d.ts +3 -1
  170. package/script/oas/discriminator/toDiscriminatorV3.d.ts.map +1 -1
  171. package/script/oas/discriminator/toDiscriminatorV3.js +7 -2
  172. package/script/oas/document/toDocumentFieldsV3.d.ts +3 -1
  173. package/script/oas/document/toDocumentFieldsV3.d.ts.map +1 -1
  174. package/script/oas/document/toDocumentFieldsV3.js +10 -9
  175. package/script/oas/example/toExamplesV3.d.ts +10 -2
  176. package/script/oas/example/toExamplesV3.d.ts.map +1 -1
  177. package/script/oas/example/toExamplesV3.js +8 -7
  178. package/script/oas/externalDocs/toExternalDocs.d.ts +3 -1
  179. package/script/oas/externalDocs/toExternalDocs.d.ts.map +1 -1
  180. package/script/oas/externalDocs/toExternalDocs.js +1 -1
  181. package/script/oas/header/toHeadersV3.d.ts +3 -1
  182. package/script/oas/header/toHeadersV3.d.ts.map +1 -1
  183. package/script/oas/header/toHeadersV3.js +8 -7
  184. package/script/oas/info/toInfoV3.d.ts +3 -1
  185. package/script/oas/info/toInfoV3.d.ts.map +1 -1
  186. package/script/oas/info/toInfoV3.js +4 -3
  187. package/script/oas/integer/toInteger.d.ts +5 -2
  188. package/script/oas/integer/toInteger.d.ts.map +1 -1
  189. package/script/oas/integer/toInteger.js +17 -9
  190. package/script/oas/license/toLicenseV3.d.ts +2 -1
  191. package/script/oas/license/toLicenseV3.d.ts.map +1 -1
  192. package/script/oas/license/toLicenseV3.js +2 -1
  193. package/script/oas/mediaType/toMediaTypeItemV3.d.ts +10 -3
  194. package/script/oas/mediaType/toMediaTypeItemV3.d.ts.map +1 -1
  195. package/script/oas/mediaType/toMediaTypeItemV3.js +9 -8
  196. package/script/oas/number/toNumber.d.ts +3 -1
  197. package/script/oas/number/toNumber.d.ts.map +1 -1
  198. package/script/oas/number/toNumber.js +15 -7
  199. package/script/oas/object/toAdditionalPropertiesV3.d.ts +3 -1
  200. package/script/oas/object/toAdditionalPropertiesV3.d.ts.map +1 -1
  201. package/script/oas/object/toAdditionalPropertiesV3.js +2 -2
  202. package/script/oas/object/toObject.d.ts +3 -1
  203. package/script/oas/object/toObject.d.ts.map +1 -1
  204. package/script/oas/object/toObject.js +15 -9
  205. package/script/oas/operation/toOperationsV3.d.ts +5 -2
  206. package/script/oas/operation/toOperationsV3.d.ts.map +1 -1
  207. package/script/oas/operation/toOperationsV3.js +14 -12
  208. package/script/oas/parameter/toParameterV3.d.ts +7 -3
  209. package/script/oas/parameter/toParameterV3.d.ts.map +1 -1
  210. package/script/oas/parameter/toParameterV3.js +18 -16
  211. package/script/oas/pathItem/toPathItemV3.d.ts +3 -1
  212. package/script/oas/pathItem/toPathItemV3.d.ts.map +1 -1
  213. package/script/oas/pathItem/toPathItemV3.js +3 -3
  214. package/script/oas/ref/toRefV31.d.ts +3 -1
  215. package/script/oas/ref/toRefV31.d.ts.map +1 -1
  216. package/script/oas/ref/toRefV31.js +3 -3
  217. package/script/oas/requestBody/toRequestBodiesV3.d.ts +5 -2
  218. package/script/oas/requestBody/toRequestBodiesV3.d.ts.map +1 -1
  219. package/script/oas/requestBody/toRequestBodiesV3.js +7 -7
  220. package/script/oas/response/toResponseV3.d.ts +7 -3
  221. package/script/oas/response/toResponseV3.d.ts.map +1 -1
  222. package/script/oas/response/toResponseV3.js +10 -9
  223. package/script/oas/schema/toSchemasV3.d.ts +9 -4
  224. package/script/oas/schema/toSchemasV3.d.ts.map +1 -1
  225. package/script/oas/schema/toSchemasV3.js +33 -25
  226. package/script/oas/securityRequirement/toSecurityRequirement.d.ts +3 -1
  227. package/script/oas/securityRequirement/toSecurityRequirement.d.ts.map +1 -1
  228. package/script/oas/securityRequirement/toSecurityRequirement.js +1 -1
  229. package/script/oas/securitySchemes/toSecuritySchemes.d.ts +3 -1
  230. package/script/oas/securitySchemes/toSecuritySchemes.d.ts.map +1 -1
  231. package/script/oas/securitySchemes/toSecuritySchemes.js +23 -8
  232. package/script/oas/server/toServerV3.d.ts +7 -3
  233. package/script/oas/server/toServerV3.d.ts.map +1 -1
  234. package/script/oas/server/toServerV3.js +7 -7
  235. package/script/oas/serverVariable/toServerVariableV3.d.ts +7 -3
  236. package/script/oas/serverVariable/toServerVariableV3.d.ts.map +1 -1
  237. package/script/oas/serverVariable/toServerVariableV3.js +6 -5
  238. package/script/oas/specificationExtensions/toSpecificationExtensionsV3.d.ts +3 -1
  239. package/script/oas/specificationExtensions/toSpecificationExtensionsV3.d.ts.map +1 -1
  240. package/script/oas/specificationExtensions/toSpecificationExtensionsV3.js +2 -2
  241. package/script/oas/string/toString.d.ts +6 -2
  242. package/script/oas/string/toString.d.ts.map +1 -1
  243. package/script/oas/string/toString.js +18 -9
  244. package/script/oas/tag/toTagsV3.d.ts +5 -2
  245. package/script/oas/tag/toTagsV3.d.ts.map +1 -1
  246. package/script/oas/tag/toTagsV3.js +4 -3
  247. package/script/oas/union/toUnion.d.ts +3 -1
  248. package/script/oas/union/toUnion.d.ts.map +1 -1
  249. package/script/oas/union/toUnion.js +4 -4
  250. package/script/oas/unknown/toUnknown.d.ts +3 -1
  251. package/script/oas/unknown/toUnknown.d.ts.map +1 -1
  252. package/script/oas/unknown/toUnknown.js +2 -1
  253. package/script/run/toArtifacts.d.ts +4 -1
  254. package/script/run/toArtifacts.d.ts.map +1 -1
  255. package/script/run/toArtifacts.js +2 -1
@@ -1,10 +1,12 @@
1
1
  import type { OpenAPIV3 } from 'openapi-types';
2
2
  import type { ParseContextType } from '../../context/parseTypes.js';
3
3
  import { OasPathItem } from './PathItem.js';
4
+ import type { StackTrail } from '../../context/StackTrail.js';
4
5
  type ToPathItemV3Args = {
5
6
  pathItem: OpenAPIV3.PathItemObject;
7
+ stackTrail: StackTrail;
6
8
  context: ParseContextType;
7
9
  };
8
- export declare const toPathItemV3: ({ pathItem, context }: ToPathItemV3Args) => OasPathItem;
10
+ export declare const toPathItemV3: ({ pathItem, stackTrail, context }: ToPathItemV3Args) => OasPathItem;
9
11
  export {};
10
12
  //# sourceMappingURL=toPathItemV3.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toPathItemV3.d.ts","sourceRoot":"","sources":["../../../src/oas/pathItem/toPathItemV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAG3C,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,SAAS,CAAC,cAAc,CAAA;IAClC,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,uBAAuB,gBAAgB,KAAG,WAgBtE,CAAA"}
1
+ {"version":3,"file":"toPathItemV3.d.ts","sourceRoot":"","sources":["../../../src/oas/pathItem/toPathItemV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7D,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,SAAS,CAAC,cAAc,CAAA;IAClC,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,mCAAmC,gBAAgB,KAAG,WAiBlF,CAAA"}
@@ -1,17 +1,17 @@
1
1
  import { toParameterListV3 } from '../parameter/toParameterV3.js';
2
2
  import { OasPathItem } from './PathItem.js';
3
3
  import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
4
- import { tracer } from '../../helpers/tracer.js';
5
- export const toPathItemV3 = ({ pathItem, context }) => {
4
+ export const toPathItemV3 = ({ pathItem, stackTrail, context }) => {
6
5
  const { summary, description, parameters, ...skipped } = pathItem;
7
6
  return new OasPathItem({
8
7
  summary,
9
8
  description,
10
- parameters: tracer(context.stackTrail, 'parameters', () => toParameterListV3({ parameters, context })),
9
+ parameters: stackTrail.trace('parameters', st => toParameterListV3({ parameters, stackTrail: st, context })),
11
10
  extensionFields: toSpecificationExtensionsV3({
12
11
  skipped,
13
12
  parent: pathItem,
14
13
  context,
14
+ stackTrail,
15
15
  parentType: 'pathItem'
16
16
  })
17
17
  });
@@ -2,11 +2,13 @@ import type { OpenAPIV3_1 } from 'openapi-types';
2
2
  import type { OasRefData } from './ref-types.js';
3
3
  import type { ParseContextType } from '../../context/parseTypes.js';
4
4
  import { OasRef } from './Ref.js';
5
+ import type { StackTrail } from '../../context/StackTrail.js';
5
6
  type ToRefV31Args<T extends OasRefData['refType']> = {
6
7
  ref: OpenAPIV3_1.ReferenceObject;
7
8
  refType: T;
9
+ stackTrail: StackTrail;
8
10
  context: ParseContextType;
9
11
  };
10
- export declare const toRefV31: <T extends OasRefData["refType"]>({ ref, refType, context }: ToRefV31Args<T>) => OasRef<T>;
12
+ export declare const toRefV31: <T extends OasRefData["refType"]>({ ref, refType, stackTrail, context }: ToRefV31Args<T>) => OasRef<T>;
11
13
  export {};
12
14
  //# sourceMappingURL=toRefV31.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toRefV31.d.ts","sourceRoot":"","sources":["../../../src/oas/ref/toRefV31.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAGjC,KAAK,YAAY,CAAC,CAAC,SAAS,UAAU,CAAC,SAAS,CAAC,IAAI;IACnD,GAAG,EAAE,WAAW,CAAC,eAAe,CAAA;IAChC,OAAO,EAAE,CAAC,CAAA;IACV,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,UAAU,CAAC,SAAS,CAAC,EAAE,2BAIvD,YAAY,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,CAAC,CAgB5B,CAAA"}
1
+ {"version":3,"file":"toRefV31.d.ts","sourceRoot":"","sources":["../../../src/oas/ref/toRefV31.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7D,KAAK,YAAY,CAAC,CAAC,SAAS,UAAU,CAAC,SAAS,CAAC,IAAI;IACnD,GAAG,EAAE,WAAW,CAAC,eAAe,CAAA;IAChC,OAAO,EAAE,CAAC,CAAA;IACV,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,UAAU,CAAC,SAAS,CAAC,EAAE,uCAKvD,YAAY,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,CAAC,CAgB5B,CAAA"}
@@ -1,11 +1,11 @@
1
1
  import { OasRef } from './Ref.js';
2
2
  import { isEmpty } from '../../helpers/isEmpty.js';
3
- export const toRefV31 = ({ ref, refType, context }) => {
3
+ export const toRefV31 = ({ ref, refType, stackTrail, context }) => {
4
4
  const { $ref, ...skipped } = ref;
5
5
  if (!isEmpty(skipped)) {
6
- context.logSkippedFields({ skipped, parent: ref, parentType: 'ref' });
6
+ context.logSkippedFields({ skipped, parent: ref, parentType: 'ref', stackTrail });
7
7
  }
8
- context.registerRef(context.stackTrail.clone(), $ref);
8
+ context.registerRef(stackTrail.clone(), $ref);
9
9
  return new OasRef({
10
10
  refType,
11
11
  $ref
@@ -2,16 +2,19 @@ import type { OpenAPIV3 } from 'openapi-types';
2
2
  import type { ParseContextType } from '../../context/parseTypes.js';
3
3
  import { OasRequestBody } from './RequestBody.js';
4
4
  import type { OasRef } from '../ref/Ref.js';
5
+ import type { StackTrail } from '../../context/StackTrail.js';
5
6
  type ToRequestBodyV3Args = {
6
7
  requestBody: OpenAPIV3.ReferenceObject | OpenAPIV3.RequestBodyObject | undefined;
7
8
  forceRef?: boolean;
9
+ stackTrail: StackTrail;
8
10
  context: ParseContextType;
9
11
  };
10
- export declare const toRequestBodyV3: ({ requestBody, context }: ToRequestBodyV3Args) => OasRequestBody | OasRef<"requestBody"> | undefined;
12
+ export declare const toRequestBodyV3: ({ requestBody, stackTrail, context }: ToRequestBodyV3Args) => OasRequestBody | OasRef<"requestBody"> | undefined;
11
13
  type ToRequestBodiesV3Args = {
12
14
  requestBodies: Record<string, OpenAPIV3.ReferenceObject | OpenAPIV3.RequestBodyObject> | undefined;
15
+ stackTrail: StackTrail;
13
16
  context: ParseContextType;
14
17
  };
15
- export declare const toRequestBodiesV3: ({ requestBodies, context }: ToRequestBodiesV3Args) => Record<string, OasRequestBody | OasRef<"requestBody">> | undefined;
18
+ export declare const toRequestBodiesV3: ({ requestBodies, stackTrail, context }: ToRequestBodiesV3Args) => Record<string, OasRequestBody | OasRef<"requestBody">> | undefined;
16
19
  export {};
17
20
  //# sourceMappingURL=toRequestBodiesV3.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toRequestBodiesV3.d.ts","sourceRoot":"","sources":["../../../src/oas/requestBody/toRequestBodiesV3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAInE,OAA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AO,CAAA;IAClB,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,sCAI7B,mBAAmB,KAAG,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,GAAG,SA6BjE,CAAA;AAED,KAAK,qBAAqB,GAAG;IAC3B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAAA;IAClG,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,wCAI/B,qBAAqB,KAAG,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,SAiBnF,CAAA"}
@@ -3,32 +3,32 @@ import { toRefV31 } from '../ref/toRefV31.js';
3
3
  import { toMediaTypeItemsV3 } from '../mediaType/toMediaTypeItemV3.js';
4
4
  import { OasRequestBody } from './RequestBody.js';
5
5
  import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
6
- import { tracer } from '../../helpers/tracer.js';
7
- export const toRequestBodyV3 = ({ requestBody, context }) => {
6
+ export const toRequestBodyV3 = ({ requestBody, stackTrail, context }) => {
8
7
  if (!requestBody) {
9
8
  return undefined;
10
9
  }
11
10
  if (isRef(requestBody)) {
12
- return toRefV31({ ref: requestBody, refType: 'requestBody', context });
11
+ return toRefV31({ ref: requestBody, refType: 'requestBody', stackTrail, context });
13
12
  }
14
13
  const { description, content, required, ...skipped } = requestBody;
15
14
  const extensionFields = toSpecificationExtensionsV3({
16
15
  skipped,
17
16
  parent: requestBody,
18
17
  context,
18
+ stackTrail,
19
19
  parentType: 'requestBody'
20
20
  });
21
21
  const fields = {
22
22
  description,
23
- content: tracer(context.stackTrail, 'content', () => {
24
- return toMediaTypeItemsV3({ content, context });
23
+ content: stackTrail.trace('content', st => {
24
+ return toMediaTypeItemsV3({ content, stackTrail: st, context });
25
25
  }),
26
26
  required,
27
27
  extensionFields
28
28
  };
29
29
  return new OasRequestBody(fields);
30
30
  };
31
- export const toRequestBodiesV3 = ({ requestBodies, context }) => {
31
+ export const toRequestBodiesV3 = ({ requestBodies, stackTrail, context }) => {
32
32
  if (!requestBodies) {
33
33
  return undefined;
34
34
  }
@@ -36,7 +36,7 @@ export const toRequestBodiesV3 = ({ requestBodies, context }) => {
36
36
  .map(([key, value]) => {
37
37
  return [
38
38
  key,
39
- tracer(context.stackTrail, key, () => toRequestBodyV3({ requestBody: value, context }))
39
+ stackTrail.trace(key, st => toRequestBodyV3({ requestBody: value, stackTrail: st, context }))
40
40
  ];
41
41
  })
42
42
  .filter(([, value]) => Boolean(value));
@@ -2,20 +2,24 @@ import type { ParseContextType } from '../../context/parseTypes.js';
2
2
  import type { OpenAPIV3 } from 'openapi-types';
3
3
  import { OasResponse } from './Response.js';
4
4
  import type { OasRef } from '../ref/Ref.js';
5
+ import type { StackTrail } from '../../context/StackTrail.js';
5
6
  type ToResponsesV3Args = {
6
7
  responses: OpenAPIV3.ResponsesObject;
8
+ stackTrail: StackTrail;
7
9
  context: ParseContextType;
8
10
  };
9
- export declare const toResponsesV3: ({ responses, context }: ToResponsesV3Args) => Record<string, OasResponse | OasRef<"response">>;
11
+ export declare const toResponsesV3: ({ responses, stackTrail, context }: ToResponsesV3Args) => Record<string, OasResponse | OasRef<"response">>;
10
12
  type ToOptionalResponsesV3Args = {
11
13
  responses: OpenAPIV3.ResponsesObject | undefined;
14
+ stackTrail: StackTrail;
12
15
  context: ParseContextType;
13
16
  };
14
- export declare const toOptionalResponsesV3: ({ responses, context }: ToOptionalResponsesV3Args) => Record<string, OasResponse | OasRef<"response">> | undefined;
17
+ export declare const toOptionalResponsesV3: ({ responses, stackTrail, context }: ToOptionalResponsesV3Args) => Record<string, OasResponse | OasRef<"response">> | undefined;
15
18
  type ToResponseV3Args = {
16
19
  response: OpenAPIV3.ReferenceObject | OpenAPIV3.ResponseObject;
20
+ stackTrail: StackTrail;
17
21
  context: ParseContextType;
18
22
  };
19
- export declare const toResponseV3: ({ response, context }: ToResponseV3Args) => OasResponse | OasRef<"response">;
23
+ export declare const toResponseV3: ({ response, stackTrail, context }: ToResponseV3Args) => OasResponse | OasRef<"response">;
20
24
  export {};
21
25
  //# sourceMappingURL=toResponseV3.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toResponseV3.d.ts","sourceRoot":"","sources":["../../../src/oas/response/toResponseV3.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAI3C,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,SAAS,CAAC,eAAe,CAAA;IACpC,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,wBAG3B,iBAAiB,KAAG,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAsBrE,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,SAAS,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAA;IAChD,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,wBAGnC,yBAAyB,KAAG,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,SAMjF,CAAA;AAED,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,cAAc,CAAA;IAC9D,OAAO,EAAE,gBAAgB,CAAA;CA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AAI,mCAI1B,gBAAgB,KAAG,WAAW,GAAG,MAAM,CAAC,UAAU,CAuBpD,CAAA"}
@@ -5,13 +5,12 @@ import { toOptionalMediaTypeItemsV3 } from '../mediaType/toMediaTypeItemV3.js';
5
5
  import { OasResponse } from './Response.js';
6
6
  import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
7
7
  import invariant from 'tiny-invariant';
8
- import { tracer } from '../../helpers/tracer.js';
9
- export const toResponsesV3 = ({ responses, context }) => {
8
+ export const toResponsesV3 = ({ responses, stackTrail, context }) => {
10
9
  const output = {};
11
10
  const entries = Object.entries(responses);
12
11
  for (const [key, value] of entries) {
13
12
  try {
14
- output[key] = tracer(context.stackTrail, key, () => toResponseV3({ response: value, context }));
13
+ output[key] = stackTrail.trace(key, st => toResponseV3({ response: value, stackTrail: st, context }));
15
14
  }
16
15
  catch (error) {
17
16
  invariant(error instanceof Error, 'Invalid error');
@@ -20,33 +19,35 @@ export const toResponsesV3 = ({ responses, context }) => {
20
19
  level: 'error',
21
20
  error,
22
21
  parent: value,
22
+ stackTrail,
23
23
  type: 'INVALID_RESPONSE'
24
24
  });
25
25
  }
26
26
  }
27
27
  return output;
28
28
  };
29
- export const toOptionalResponsesV3 = ({ responses, context }) => {
29
+ export const toOptionalResponsesV3 = ({ responses, stackTrail, context }) => {
30
30
  if (!responses) {
31
31
  return undefined;
32
32
  }
33
- return toResponsesV3({ responses, context });
33
+ return toResponsesV3({ responses, stackTrail, context });
34
34
  };
35
- export const toResponseV3 = ({ response, context }) => {
35
+ export const toResponseV3 = ({ response, stackTrail, context }) => {
36
36
  if (isRef(response)) {
37
- return toRefV31({ ref: response, refType: 'response', context });
37
+ return toRefV31({ ref: response, refType: 'response', stackTrail, context });
38
38
  }
39
39
  const { description, headers, content, ...skipped } = response;
40
40
  const extensionFields = toSpecificationExtensionsV3({
41
41
  skipped,
42
42
  parent: response,
43
43
  context,
44
+ stackTrail,
44
45
  parentType: 'response'
45
46
  });
46
47
  return new OasResponse({
47
48
  description,
48
- headers: tracer(context.stackTrail, 'headers', () => toHeadersV3({ headers, context })),
49
- content: tracer(context.stackTrail, 'content', () => toOptionalMediaTypeItemsV3({ content, context })),
49
+ headers: stackTrail.trace('headers', st => toHeadersV3({ headers, stackTrail: st, context })),
50
+ content: stackTrail.trace('content', st => toOptionalMediaTypeItemsV3({ content, stackTrail: st, context })),
50
51
  extensionFields
51
52
  });
52
53
  };
@@ -2,25 +2,30 @@ import type { ParseContextType } from '../../context/parseTypes.js';
2
2
  import type { OpenAPIV3 } from 'openapi-types';
3
3
  import type { OasSchema } from './Schema.js';
4
4
  import type { OasRef } from '../ref/Ref.js';
5
+ import type { StackTrail } from '../../context/StackTrail.js';
5
6
  type ToSchemasV3Args = {
6
7
  schemas: Record<string, OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject>;
8
+ stackTrail: StackTrail;
7
9
  context: ParseContextType;
8
10
  };
9
- export declare const toSchemasV3: ({ schemas, context }: ToSchemasV3Args) => Record<string, OasSchema | OasRef<"schema">>;
11
+ export declare const toSchemasV3: ({ schemas, stackTrail, context }: ToSchemasV3Args) => Record<string, OasSchema | OasRef<"schema">>;
10
12
  type ToOptionalSchemasV3Args = {
11
13
  schemas: Record<string, OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject> | undefined;
14
+ stackTrail: StackTrail;
12
15
  context: ParseContextType;
13
16
  };
14
- export declare const toOptionalSchemasV3: ({ schemas, context }: ToOptionalSchemasV3Args) => Record<string, OasSchema | OasRef<"schema">> | undefined;
17
+ export declare const toOptionalSchemasV3: ({ schemas, stackTrail, context }: ToOptionalSchemasV3Args) => Record<string, OasSchema | OasRef<"schema">> | undefined;
15
18
  type ToSchemaV3Args = {
16
19
  schema: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject;
20
+ stackTrail: StackTrail;
17
21
  context: ParseContextType;
18
22
  };
19
- export declare const toSchemaV3: ({ schema, context }: ToSchemaV3Args) => OasSchema | OasRef<"schema">;
23
+ export declare const toSchemaV3: ({ schema, stackTrail, context }: ToSchemaV3Args) => OasSchema | OasRef<"schema">;
20
24
  type ToOptionalSchemaV3Args = {
21
25
  schema: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject | undefined;
26
+ stackTrail: StackTrail;
22
27
  context: ParseContextType;
23
28
  };
24
- export declare const toOptionalSchemaV3: ({ schema, context }: ToOptionalSchemaV3Args) => OasSchema | OasRef<"schema"> | undefined;
29
+ export declare const toOptionalSchemaV3: ({ schema, stackTrail, context }: ToOptionalSchemaV3Args) => OasSchema | OasRef<"schema"> | undefined;
25
30
  export {};
26
31
  //# sourceMappingURL=toSchemasV3.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toSchemasV3.d.ts","sourceRoot":"","sources":["../../../src/oas/schema/toSchemasV3.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAc3C,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,CAAA;IAC3E,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,sBAGzB,eAAe,KAAG,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAqB/D,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAA;IACvF,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAA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IzB,eAAe,KAAG,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAsB/D,CAAA;AAED,KAAK,uBAAuB,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAA;IACvF,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,kCAIjC,uBAAuB,KAAG,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,SAM3E,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,CAAA;IAC1D,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,iCAIxB,cAAc,KAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAiK9C,CAAA;AA+CD,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,YAAY,GAAG,SAAS,CAAA;IACtE,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,iCAIhC,sBAAsB,KAAG,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,SAM1D,CAAA"}
@@ -13,13 +13,12 @@ import { toGetRef } from '../../helpers/refFns.js';
13
13
  import { mergeIntersection } from '../_merge-all-of/merge-intersection.js';
14
14
  import { mergeUnion } from '../_merge-all-of/merge-union.js';
15
15
  import invariant from 'tiny-invariant';
16
- import { tracer } from '../../helpers/tracer.js';
17
- export const toSchemasV3 = ({ schemas, context }) => {
16
+ export const toSchemasV3 = ({ schemas, stackTrail, context }) => {
18
17
  const output = {};
19
18
  const entries = Object.entries(schemas);
20
19
  for (const [key, schema] of entries) {
21
20
  try {
22
- output[key] = tracer(context.stackTrail, key, () => toSchemaV3({ schema, context }));
21
+ output[key] = stackTrail.trace(key, st => toSchemaV3({ schema, stackTrail: st, context }));
23
22
  }
24
23
  catch (error) {
25
24
  invariant(error instanceof Error, 'Invalid error');
@@ -28,34 +27,35 @@ export const toSchemasV3 = ({ schemas, context }) => {
28
27
  level: 'error',
29
28
  error,
30
29
  parent: schema,
30
+ stackTrail,
31
31
  type: 'INVALID_SCHEMA'
32
32
  });
33
33
  }
34
34
  }
35
35
  return output;
36
36
  };
37
- export const toOptionalSchemasV3 = ({ schemas, context }) => {
37
+ export const toOptionalSchemasV3 = ({ schemas, stackTrail, context }) => {
38
38
  if (!schemas) {
39
39
  return undefined;
40
40
  }
41
- return toSchemasV3({ schemas, context });
41
+ return toSchemasV3({ schemas, stackTrail, context });
42
42
  };
43
- export const toSchemaV3 = ({ schema, context }) => {
43
+ export const toSchemaV3 = ({ schema, stackTrail, context }) => {
44
44
  if (isRef(schema)) {
45
- return toRefV31({ ref: schema, refType: 'schema', context });
45
+ return toRefV31({ ref: schema, refType: 'schema', stackTrail, context });
46
46
  }
47
47
  return match(schema)
48
48
  .with({ allOf: P.array() }, schema => {
49
- return tracer(context.stackTrail, 'allOf', () => {
49
+ return stackTrail.trace('allOf', st => {
50
50
  const merged = mergeIntersection({
51
51
  schema,
52
52
  getRef: toGetRef(context.documentObject)
53
53
  });
54
- return toSchemaV3({ schema: merged, context });
54
+ return toSchemaV3({ schema: merged, stackTrail: st, context });
55
55
  });
56
56
  })
57
57
  .with({ oneOf: P.array() }, oneOf => {
58
- return tracer(context.stackTrail, 'oneOf', () => {
58
+ return stackTrail.trace('oneOf', st => {
59
59
  const merged = mergeUnion({
60
60
  schema: oneOf,
61
61
  getRef: toGetRef(context.documentObject),
@@ -69,18 +69,18 @@ export const toSchemaV3 = ({ schema, context }) => {
69
69
  throw new Error('"oneOf" array is empty');
70
70
  }
71
71
  if (members.length === 1) {
72
- return toSchemaV3({ schema: members[0], context });
72
+ return toSchemaV3({ schema: members[0], stackTrail: st, context });
73
73
  }
74
- return toUnion({ value, members, parentType: 'oneOf', context });
74
+ return toUnion({ value, members, parentType: 'oneOf', stackTrail: st, context });
75
75
  });
76
76
  })
77
77
  .with({ anyOf: P.array() }, matched => {
78
- return tracer(context.stackTrail, 'anyOf', () => {
78
+ return stackTrail.trace('anyOf', st => {
79
79
  // deno-lint-ignore ban-ts-comment
80
80
  // @ts-expect-error
81
81
  if (matched['x-expansionResources']) {
82
82
  const { anyOf, ...value } = matched;
83
- return toUnion({ value, members: anyOf, parentType: 'anyOf', context });
83
+ return toUnion({ value, members: anyOf, parentType: 'anyOf', stackTrail: st, context });
84
84
  }
85
85
  const merged = mergeUnion({
86
86
  schema: matched,
@@ -95,23 +95,24 @@ export const toSchemaV3 = ({ schema, context }) => {
95
95
  throw new Error('"anyOf" array is empty');
96
96
  }
97
97
  if (members.length === 1) {
98
- return toSchemaV3({ schema: members[0], context });
98
+ return toSchemaV3({ schema: members[0], stackTrail: st, context });
99
99
  }
100
- return toUnion({ value, members, parentType: 'anyOf', context });
100
+ return toUnion({ value, members, parentType: 'anyOf', stackTrail: st, context });
101
101
  });
102
102
  })
103
- .with({ type: 'object' }, value => toObject({ value, context }))
104
- .with({ type: 'array' }, value => toArray({ value, context }))
105
- .with({ type: 'integer' }, value => toInteger({ value, context }))
106
- .with({ type: 'number' }, value => toNumber({ value, context }))
107
- .with({ type: 'boolean' }, value => toBoolean({ value, context }))
108
- .with({ type: 'string' }, value => toString({ value, context }))
103
+ .with({ type: 'object' }, value => toObject({ value, stackTrail, context }))
104
+ .with({ type: 'array' }, value => toArray({ value, stackTrail, context }))
105
+ .with({ type: 'integer' }, value => toInteger({ value, stackTrail, context }))
106
+ .with({ type: 'number' }, value => toNumber({ value, stackTrail, context }))
107
+ .with({ type: 'boolean' }, value => toBoolean({ value, stackTrail, context }))
108
+ .with({ type: 'string' }, value => toString({ value, stackTrail, context }))
109
109
  .otherwise(value => {
110
110
  if (possibleObject(value)) {
111
111
  context.logIssueNoKey({
112
112
  level: 'warning',
113
113
  message: 'Object has "properties" property, but is missing type="object" property',
114
114
  parent: value,
115
+ stackTrail,
115
116
  type: 'MISSING_OBJECT_TYPE'
116
117
  });
117
118
  return toObject({
@@ -119,6 +120,7 @@ export const toSchemaV3 = ({ schema, context }) => {
119
120
  ...value,
120
121
  type: 'object'
121
122
  },
123
+ stackTrail,
122
124
  context
123
125
  });
124
126
  }
@@ -127,6 +129,7 @@ export const toSchemaV3 = ({ schema, context }) => {
127
129
  level: 'warning',
128
130
  message: 'Object has "items" property, but is missing type="array" property',
129
131
  parent: value,
132
+ stackTrail,
130
133
  type: 'MISSING_ARRAY_TYPE'
131
134
  });
132
135
  return toArray({
@@ -135,6 +138,7 @@ export const toSchemaV3 = ({ schema, context }) => {
135
138
  type: 'array'
136
139
  // Adding cast here since {} is a valid value for items
137
140
  },
141
+ stackTrail,
138
142
  context
139
143
  });
140
144
  }
@@ -143,6 +147,7 @@ export const toSchemaV3 = ({ schema, context }) => {
143
147
  level: 'warning',
144
148
  message: 'Object has a boolean "default" or "example" property, but is missing type="boolean" property',
145
149
  parent: value,
150
+ stackTrail,
146
151
  type: 'MISSING_BOOLEAN_TYPE'
147
152
  });
148
153
  return toBoolean({
@@ -150,6 +155,7 @@ export const toSchemaV3 = ({ schema, context }) => {
150
155
  ...value,
151
156
  type: 'boolean'
152
157
  },
158
+ stackTrail,
153
159
  context
154
160
  });
155
161
  }
@@ -158,6 +164,7 @@ export const toSchemaV3 = ({ schema, context }) => {
158
164
  level: 'warning',
159
165
  message: 'Object has a string "default" or "example" property, but is missing type="string" property',
160
166
  parent: value,
167
+ stackTrail,
161
168
  type: 'MISSING_STRING_TYPE'
162
169
  });
163
170
  return toString({
@@ -165,10 +172,11 @@ export const toSchemaV3 = ({ schema, context }) => {
165
172
  ...value,
166
173
  type: 'string'
167
174
  },
175
+ stackTrail,
168
176
  context
169
177
  });
170
178
  }
171
- return toUnknown({ value, context });
179
+ return toUnknown({ value, stackTrail, context });
172
180
  });
173
181
  };
174
182
  const possibleString = (value) => {
@@ -204,9 +212,9 @@ const possibleObject = (value) => {
204
212
  typeof value.properties === 'object' &&
205
213
  value.properties);
206
214
  };
207
- export const toOptionalSchemaV3 = ({ schema, context }) => {
215
+ export const toOptionalSchemaV3 = ({ schema, stackTrail, context }) => {
208
216
  if (!schema) {
209
217
  return undefined;
210
218
  }
211
- return toSchemaV3({ schema, context });
219
+ return toSchemaV3({ schema, stackTrail, context });
212
220
  };
@@ -1,9 +1,11 @@
1
1
  import type { ParseContextType } from '../../context/parseTypes.js';
2
2
  import { OasSecurityRequirement } from './SecurityRequirement.js';
3
+ import type { StackTrail } from '../../context/StackTrail.js';
3
4
  type ToSecurityRequirementsV3Args = {
4
5
  security: Record<string, string[]>[] | undefined;
6
+ stackTrail: StackTrail;
5
7
  context: ParseContextType;
6
8
  };
7
- export declare const toSecurityRequirementsV3: ({ security, context }: ToSecurityRequirementsV3Args) => OasSecurityRequirement[] | undefined;
9
+ export declare const toSecurityRequirementsV3: ({ security, stackTrail, context }: ToSecurityRequirementsV3Args) => OasSecurityRequirement[] | undefined;
8
10
  export {};
9
11
  //# sourceMappingURL=toSecurityRequirement.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toSecurityRequirement.d.ts","sourceRoot":"","sources":["../../../src/oas/securityRequirement/toSecurityRequirement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,KAAK,4BAA4B,GAAG;IAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,CAAA;IAChD,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,wBAAwB,GAAI,uBAGtC,4BAA4B,KAAG,sBAAsB,EAAE,GAAG,SAQ5D,CAAA"}
1
+ {"version":3,"file":"toSecurityRequirement.d.ts","sourceRoot":"","sources":["../../../src/oas/securityRequirement/toSecurityRequirement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,KAAK,4BAA4B,GAAG;IAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,CAAA;IAChD,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,wBAAwB,GAAI,mCAItC,4BAA4B,KAAG,sBAAsB,EAAE,GAAG,SAQ5D,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { OasSecurityRequirement } from './SecurityRequirement.js';
2
- export const toSecurityRequirementsV3 = ({ security, context }) => {
2
+ export const toSecurityRequirementsV3 = ({ security, stackTrail, context }) => {
3
3
  if (!security) {
4
4
  return undefined;
5
5
  }
@@ -1,11 +1,13 @@
1
1
  import type { OpenAPIV3 } from 'openapi-types';
2
2
  import type { ParseContextType } from '../../context/parseTypes.js';
3
3
  import type { OasSecurityScheme } from './SecurityScheme.js';
4
+ import type { StackTrail } from '../../context/StackTrail.js';
4
5
  type ToSecuritySchemesArgs = {
5
6
  securitySchemes: Record<string, OpenAPIV3.ReferenceObject | OpenAPIV3.SecuritySchemeObject> | undefined;
7
+ stackTrail: StackTrail;
6
8
  context: ParseContextType;
7
9
  };
8
- export declare const toSecuritySchemesV3: ({ securitySchemes, context }: ToSecuritySchemesArgs) => // 'http' | 'apiKey' | 'oauth2' | 'openIdConnect'
10
+ export declare const toSecuritySchemesV3: ({ securitySchemes, stackTrail, context }: ToSecuritySchemesArgs) => // 'http' | 'apiKey' | 'oauth2' | 'openIdConnect'
9
11
  Record<string, OasSecurityScheme> | undefined;
10
12
  export {};
11
13
  //# sourceMappingURL=toSecuritySchemes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toSecuritySchemes.d.ts","sourceRoot":"","sources":["../../../src/oas/securitySchemes/toSecuritySchemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAgBnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAM5D,KAAK,qBAAqB,GAAG;IAC3B,eAAe,EACX,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,oBAAoB,CAAC,GAC1E,SAAS,CAAA;IACb,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,8BAGjC,qBAAqB,KACxB,AAD2B,iDAAiD;AAC5E,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,SAenC,CAAA"}
1
+ {"version":3,"file":"toSecuritySchemes.d.ts","sourceRoot":"","sources":["../../../src/oas/securitySchemes/toSecuritySchemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAgBnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAK5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAC7D,KAAK,qBAAqB,GAAG;IAC3B,eAAe,EACX,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,oBAAoB,CAAC,GAC1E,SAAS,CAAA;IACb,UAAU,EAAE,UAAU,CAAA;IACtB,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,0CAIjC,qBAAqB,KACxB,AAD2B,iDAAiD;AAC5E,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAAG,SAenC,CAAA"}
@@ -4,28 +4,32 @@ import * as v from 'valibot';
4
4
  import { oasApiKeySecuritySchemeData, oasHttpSecuritySchemeData, oasOAuth2SecuritySchemeData, oasOpenIdSecuritySchemeData } from './security-scheme-types.js';
5
5
  import { toRefV31 } from '../ref/toRefV31.js';
6
6
  import { isRef } from '../../helpers/refFns.js';
7
- import { tracer } from '../../helpers/tracer.js';
8
7
  import { isEmpty } from '../../helpers/isEmpty.js';
9
- export const toSecuritySchemesV3 = ({ securitySchemes, context }) => {
8
+ export const toSecuritySchemesV3 = ({ securitySchemes, stackTrail, context }) => {
10
9
  if (!securitySchemes) {
11
10
  return undefined;
12
11
  }
13
12
  return Object.fromEntries(Object.entries(securitySchemes).map(([key, value]) => {
14
13
  return [
15
14
  key,
16
- tracer(context.stackTrail, key, () => toSecuritySchemeV3({ securityScheme: value, context }))
15
+ stackTrail.trace(key, st => toSecuritySchemeV3({ securityScheme: value, stackTrail: st, context }))
17
16
  ];
18
17
  }));
19
18
  };
20
- const toSecuritySchemeV3 = ({ securityScheme, context }) => {
19
+ const toSecuritySchemeV3 = ({ securityScheme, stackTrail, context }) => {
21
20
  if (isRef(securityScheme)) {
22
- return toRefV31({ ref: securityScheme, refType: 'securityScheme', context });
21
+ return toRefV31({ ref: securityScheme, refType: 'securityScheme', stackTrail, context });
23
22
  }
24
23
  return match(securityScheme)
25
24
  .with({ type: 'http' }, matched => {
26
25
  const { type: _type, description, scheme, bearerFormat, ...skipped } = v.parse(oasHttpSecuritySchemeData, matched);
27
26
  if (!isEmpty(skipped)) {
28
- context.logSkippedFields({ skipped, parent: matched, parentType: 'securityScheme:http' });
27
+ context.logSkippedFields({
28
+ skipped,
29
+ parent: matched,
30
+ stackTrail,
31
+ parentType: 'securityScheme:http'
32
+ });
29
33
  }
30
34
  return new OasHttpSecurityScheme({
31
35
  description,
@@ -36,7 +40,12 @@ const toSecuritySchemeV3 = ({ securityScheme, context }) => {
36
40
  .with({ type: 'apiKey' }, matched => {
37
41
  const { type: _type, in: location, description, name, ...skipped } = v.parse(oasApiKeySecuritySchemeData, matched);
38
42
  if (!isEmpty(skipped)) {
39
- context.logSkippedFields({ skipped, parent: matched, parentType: 'securityScheme:apiKey' });
43
+ context.logSkippedFields({
44
+ skipped,
45
+ parent: matched,
46
+ stackTrail,
47
+ parentType: 'securityScheme:apiKey'
48
+ });
40
49
  }
41
50
  return new OasApiKeySecurityScheme({
42
51
  description,
@@ -47,7 +56,12 @@ const toSecuritySchemeV3 = ({ securityScheme, context }) => {
47
56
  .with({ type: 'oauth2' }, matched => {
48
57
  const { type: _type, flows, description, ...skipped } = v.parse(oasOAuth2SecuritySchemeData, matched);
49
58
  if (!isEmpty(skipped)) {
50
- context.logSkippedFields({ skipped, parent: matched, parentType: 'securityScheme:oauth2' });
59
+ context.logSkippedFields({
60
+ skipped,
61
+ parent: matched,
62
+ stackTrail,
63
+ parentType: 'securityScheme:oauth2'
64
+ });
51
65
  }
52
66
  return new OasOAuth2SecurityScheme({
53
67
  description,
@@ -60,6 +74,7 @@ const toSecuritySchemeV3 = ({ securityScheme, context }) => {
60
74
  context.logSkippedFields({
61
75
  skipped,
62
76
  parent: matched,
77
+ stackTrail,
63
78
  parentType: 'securityScheme:openIdConnect'
64
79
  });
65
80
  }