@scalar/workspace-store 0.68.1 → 0.68.3

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 (179) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/channel-example/get-async-api-protocols.d.ts +3 -1
  3. package/dist/channel-example/get-async-api-protocols.d.ts.map +1 -1
  4. package/dist/channel-example/get-async-api-protocols.js +6 -2
  5. package/dist/channel-example/get-asyncapi-security-requirements.d.ts +14 -2
  6. package/dist/channel-example/get-asyncapi-security-requirements.d.ts.map +1 -1
  7. package/dist/channel-example/get-asyncapi-security-requirements.js +89 -32
  8. package/dist/channel-example/get-channel-connection-context.d.ts.map +1 -1
  9. package/dist/channel-example/get-channel-connection-context.js +3 -4
  10. package/dist/channel-example/get-channel-connection-security.d.ts +3 -2
  11. package/dist/channel-example/get-channel-connection-security.d.ts.map +1 -1
  12. package/dist/channel-example/get-channel-connection-security.js +4 -6
  13. package/dist/channel-example/get-channel-operations.d.ts.map +1 -1
  14. package/dist/channel-example/get-channel-operations.js +2 -1
  15. package/dist/channel-example/get-channel-parameters.d.ts.map +1 -1
  16. package/dist/channel-example/get-channel-parameters.js +2 -1
  17. package/dist/channel-example/index.d.ts +2 -2
  18. package/dist/channel-example/index.d.ts.map +1 -1
  19. package/dist/channel-example/index.js +2 -2
  20. package/dist/channel-example/resolve-channel.d.ts.map +1 -1
  21. package/dist/channel-example/resolve-channel.js +2 -1
  22. package/dist/channel-example/resolve-operation-channel.d.ts.map +1 -1
  23. package/dist/channel-example/resolve-operation-channel.js +4 -2
  24. package/dist/channel-example/resolve-operation-with-traits.d.ts +1 -3
  25. package/dist/channel-example/resolve-operation-with-traits.d.ts.map +1 -1
  26. package/dist/channel-example/resolve-operation-with-traits.js +3 -41
  27. package/dist/channel-example/servers.d.ts.map +1 -1
  28. package/dist/channel-example/servers.js +2 -1
  29. package/dist/client.d.ts.map +1 -1
  30. package/dist/client.js +15 -4
  31. package/dist/entities/auth/schema.d.ts +5 -0
  32. package/dist/entities/auth/schema.d.ts.map +1 -1
  33. package/dist/events/definitions/operation.d.ts +7 -0
  34. package/dist/events/definitions/operation.d.ts.map +1 -1
  35. package/dist/helpers/asyncapi-chunk-groups.d.ts.map +1 -1
  36. package/dist/helpers/asyncapi-chunk-groups.js +8 -4
  37. package/dist/helpers/asyncapi-model-chunk-reference.d.ts.map +1 -1
  38. package/dist/helpers/asyncapi-model-chunk-reference.js +2 -1
  39. package/dist/helpers/auth-secret-fields.d.ts +11 -0
  40. package/dist/helpers/auth-secret-fields.d.ts.map +1 -1
  41. package/dist/helpers/auth-secret-fields.js +22 -0
  42. package/dist/helpers/chunk-index.d.ts +2 -0
  43. package/dist/helpers/chunk-index.d.ts.map +1 -1
  44. package/dist/helpers/chunk-index.js +8 -1
  45. package/dist/helpers/encode-path-parameter.d.ts +20 -0
  46. package/dist/helpers/encode-path-parameter.d.ts.map +1 -0
  47. package/dist/helpers/encode-path-parameter.js +50 -0
  48. package/dist/helpers/external-examples.d.ts.map +1 -1
  49. package/dist/helpers/external-examples.js +6 -3
  50. package/dist/helpers/get-boolean-schema.d.ts +7 -0
  51. package/dist/helpers/get-boolean-schema.d.ts.map +1 -0
  52. package/dist/helpers/get-boolean-schema.js +5 -0
  53. package/dist/helpers/get-resolved-ref-deep.d.ts.map +1 -1
  54. package/dist/helpers/get-tag-kind.d.ts +6 -0
  55. package/dist/helpers/get-tag-kind.d.ts.map +1 -0
  56. package/dist/helpers/get-tag-kind.js +7 -0
  57. package/dist/helpers/normalize-boolean-schemas.d.ts.map +1 -1
  58. package/dist/helpers/normalize-boolean-schemas.js +6 -1
  59. package/dist/helpers/operation-examples.d.ts.map +1 -1
  60. package/dist/helpers/operation-examples.js +2 -1
  61. package/dist/helpers/querystring-parameter.d.ts.map +1 -1
  62. package/dist/helpers/querystring-parameter.js +6 -6
  63. package/dist/helpers/resolve-form-schema.d.ts +9 -0
  64. package/dist/helpers/resolve-form-schema.d.ts.map +1 -0
  65. package/dist/helpers/resolve-form-schema.js +143 -0
  66. package/dist/helpers/resolve-schema-with-annotations.d.ts +11 -0
  67. package/dist/helpers/resolve-schema-with-annotations.d.ts.map +1 -0
  68. package/dist/helpers/resolve-schema-with-annotations.js +57 -0
  69. package/dist/helpers/resolve-security-requirements.d.ts +15 -0
  70. package/dist/helpers/resolve-security-requirements.d.ts.map +1 -0
  71. package/dist/helpers/resolve-security-requirements.js +241 -0
  72. package/dist/helpers/resolve-traits.d.ts +3 -0
  73. package/dist/helpers/resolve-traits.d.ts.map +1 -0
  74. package/dist/helpers/resolve-traits.js +68 -0
  75. package/dist/helpers/serialize-stream-example.js +1 -1
  76. package/dist/helpers/use-external-examples.d.ts.map +1 -1
  77. package/dist/helpers/use-external-examples.js +10 -5
  78. package/dist/mutators/auth.d.ts.map +1 -1
  79. package/dist/mutators/auth.js +2 -1
  80. package/dist/mutators/operation/helpers/har-to-operation.d.ts.map +1 -1
  81. package/dist/mutators/operation/helpers/har-to-operation.js +4 -2
  82. package/dist/mutators/operation/operation.d.ts.map +1 -1
  83. package/dist/mutators/operation/operation.js +4 -2
  84. package/dist/mutators/operation/parameters.d.ts.map +1 -1
  85. package/dist/mutators/operation/parameters.js +23 -1
  86. package/dist/mutators/tag.d.ts.map +1 -1
  87. package/dist/mutators/tag.js +4 -2
  88. package/dist/navigation/get-navigation-options.js +6 -5
  89. package/dist/navigation/helpers/get-navigation-tag-names.d.ts +5 -0
  90. package/dist/navigation/helpers/get-navigation-tag-names.d.ts.map +1 -0
  91. package/dist/navigation/helpers/get-navigation-tag-names.js +3 -0
  92. package/dist/navigation/helpers/traverse-asyncapi-document.d.ts.map +1 -1
  93. package/dist/navigation/helpers/traverse-asyncapi-document.js +27 -20
  94. package/dist/navigation/helpers/traverse-paths.d.ts.map +1 -1
  95. package/dist/navigation/helpers/traverse-paths.js +5 -3
  96. package/dist/navigation/helpers/traverse-schemas.d.ts.map +1 -1
  97. package/dist/navigation/helpers/traverse-schemas.js +6 -3
  98. package/dist/navigation/helpers/traverse-tags.d.ts.map +1 -1
  99. package/dist/navigation/helpers/traverse-tags.js +8 -4
  100. package/dist/navigation/helpers/traverse-webhooks.d.ts.map +1 -1
  101. package/dist/navigation/helpers/traverse-webhooks.js +4 -2
  102. package/dist/plugins/bundler/index.d.ts.map +1 -1
  103. package/dist/plugins/bundler/index.js +2 -1
  104. package/dist/plugins/bundler/openapi-document.d.ts.map +1 -1
  105. package/dist/plugins/bundler/openapi-document.js +2 -1
  106. package/dist/request-example/builder/body/build-multipart.d.ts.map +1 -1
  107. package/dist/request-example/builder/body/build-multipart.js +18 -16
  108. package/dist/request-example/builder/body/build-request-body.d.ts.map +1 -1
  109. package/dist/request-example/builder/body/build-request-body.js +3 -5
  110. package/dist/request-example/builder/body/encode-multipart-body.d.ts.map +1 -1
  111. package/dist/request-example/builder/body/encode-multipart-body.js +2 -1
  112. package/dist/request-example/builder/body/get-request-body-example.d.ts.map +1 -1
  113. package/dist/request-example/builder/body/get-request-body-example.js +2 -1
  114. package/dist/request-example/builder/body/schema-value-coercion.d.ts.map +1 -1
  115. package/dist/request-example/builder/body/schema-value-coercion.js +9 -8
  116. package/dist/request-example/builder/build-request.d.ts.map +1 -1
  117. package/dist/request-example/builder/build-request.js +3 -0
  118. package/dist/request-example/builder/header/build-request-parameters.d.ts +7 -1
  119. package/dist/request-example/builder/header/build-request-parameters.d.ts.map +1 -1
  120. package/dist/request-example/builder/header/build-request-parameters.js +34 -3
  121. package/dist/request-example/builder/header/filter-disabled-properties.d.ts +3 -0
  122. package/dist/request-example/builder/header/filter-disabled-properties.d.ts.map +1 -0
  123. package/dist/request-example/builder/header/filter-disabled-properties.js +18 -0
  124. package/dist/request-example/builder/header/filter-global-cookies.d.ts +1 -1
  125. package/dist/request-example/builder/header/filter-global-cookies.d.ts.map +1 -1
  126. package/dist/request-example/builder/header/filter-global-cookies.js +15 -3
  127. package/dist/request-example/builder/header/is-param-disabled.d.ts +1 -1
  128. package/dist/request-example/builder/header/is-param-disabled.d.ts.map +1 -1
  129. package/dist/request-example/builder/header/is-param-disabled.js +3 -2
  130. package/dist/request-example/builder/helpers/get-example-from-schema.d.ts.map +1 -1
  131. package/dist/request-example/builder/helpers/get-example-from-schema.js +20 -16
  132. package/dist/request-example/builder/helpers/get-example.d.ts +2 -0
  133. package/dist/request-example/builder/helpers/get-example.d.ts.map +1 -1
  134. package/dist/request-example/builder/helpers/get-example.js +15 -5
  135. package/dist/request-example/builder/index.d.ts +1 -0
  136. package/dist/request-example/builder/index.d.ts.map +1 -1
  137. package/dist/request-example/builder/index.js +1 -0
  138. package/dist/request-example/builder/request-factory.d.ts +6 -1
  139. package/dist/request-example/builder/request-factory.d.ts.map +1 -1
  140. package/dist/request-example/builder/request-factory.js +3 -1
  141. package/dist/request-example/builder/resolve-request-factory-url.d.ts.map +1 -1
  142. package/dist/request-example/builder/resolve-request-factory-url.js +23 -7
  143. package/dist/request-example/builder/security/secret-types.d.ts +13 -3
  144. package/dist/request-example/builder/security/secret-types.d.ts.map +1 -1
  145. package/dist/request-example/context/headers.js +1 -1
  146. package/dist/request-example/context/security/extract-security-scheme-secrets.d.ts.map +1 -1
  147. package/dist/request-example/context/security/extract-security-scheme-secrets.js +63 -25
  148. package/dist/request-example/context/security/get-selected-security.js +1 -1
  149. package/dist/request-example/context/security/merge-security.d.ts.map +1 -1
  150. package/dist/request-example/context/security/merge-security.js +2 -1
  151. package/dist/request-example/index.d.ts +1 -1
  152. package/dist/request-example/index.d.ts.map +1 -1
  153. package/dist/request-example/index.js +1 -1
  154. package/dist/request-example/xml/get-xml-example.js +2 -1
  155. package/dist/request-example/xml/write-xml.d.ts.map +1 -1
  156. package/dist/request-example/xml/write-xml.js +6 -5
  157. package/dist/resolve.d.ts +1 -1
  158. package/dist/resolve.d.ts.map +1 -1
  159. package/dist/resolve.js +16 -1
  160. package/dist/schemas/extensions/example/x-disabled.d.ts +4 -0
  161. package/dist/schemas/extensions/example/x-disabled.d.ts.map +1 -1
  162. package/dist/schemas/extensions/example/x-disabled.js +3 -1
  163. package/dist/schemas/navigation.d.ts +1 -1
  164. package/dist/schemas/navigation.d.ts.map +1 -1
  165. package/dist/schemas/reference-config/index.d.ts +1 -0
  166. package/dist/schemas/reference-config/index.d.ts.map +1 -1
  167. package/dist/schemas/reference-config/settings.d.ts +1 -0
  168. package/dist/schemas/reference-config/settings.d.ts.map +1 -1
  169. package/dist/schemas/v3.1/strict/example.d.ts +3 -0
  170. package/dist/schemas/v3.1/strict/example.d.ts.map +1 -1
  171. package/dist/schemas/v3.1/strict/openapi-document.d.ts +36 -6
  172. package/dist/schemas/v3.1/strict/openapi-document.d.ts.map +1 -1
  173. package/dist/schemas/v3.2/strict/example.d.ts +3 -0
  174. package/dist/schemas/v3.2/strict/example.d.ts.map +1 -1
  175. package/dist/schemas/v3.2/strict/openapi-document.d.ts +36 -6
  176. package/dist/schemas/v3.2/strict/openapi-document.d.ts.map +1 -1
  177. package/dist/server.d.ts.map +1 -1
  178. package/dist/server.js +37 -8
  179. package/package.json +9 -9
@@ -98,8 +98,9 @@ export const harToOperation = ({ harRequest, exampleKey, baseOperation = {}, pat
98
98
  }
99
99
  // Resolve the request body in case it is a reference
100
100
  const requestBody = getResolvedRef(baseOperation.requestBody);
101
- if (!requestBody)
101
+ if (!requestBody) {
102
102
  return baseOperation;
103
+ }
103
104
  // Ensure the content type exists in the requestBody
104
105
  if (!requestBody.content[mimeType]) {
105
106
  requestBody.content[mimeType] = {
@@ -150,8 +151,9 @@ const setParameterDisabled = (param, exampleKey, disabled) => {
150
151
  return;
151
152
  }
152
153
  const example = getResolvedRef(param.examples[exampleKey]);
153
- if (example)
154
+ if (example) {
154
155
  example['x-disabled'] = disabled;
156
+ }
155
157
  };
156
158
  /**
157
159
  * Finds an existing parameter in the parameters array or creates a new one.
@@ -1 +1 @@
1
- {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../src/mutators/operation/operation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAarE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAGlD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,eAAe,GAC1B,gBAAgB,cAAc,GAAG,IAAI,EACrC,SAAS,eAAe,CAAC,4BAA4B,CAAC,KACrD,MAAM,GAAG,SA0DX,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,GAC9B,OAAO,cAAc,GAAG,IAAI,EAC5B,UAAU,iBAAiB,GAAG,IAAI,EAClC,mBAAmB,eAAe,CAAC,uBAAuB,CAAC,SAsB5D,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,yBAAyB,GACpC,UAAU,iBAAiB,GAAG,IAAI,EAClC,OAAO,cAAc,GAAG,IAAI,EAC5B,mEAAmE,eAAe,CAAC,6BAA6B,CAAC,KAChH,IAkGF,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GAC1B,WAAW,cAAc,GAAG,IAAI,EAChC,wBAAwB,eAAe,CAAC,4BAA4B,CAAC,SAgBtE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,GACtC,WAAW,cAAc,GAAG,IAAI,EAChC,uDAAuD,eAAe,CAAC,gCAAgC,CAAC,SAuBzG,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GACjC,WAAW,cAAc,GAAG,IAAI,EAChC,sDAAsD,eAAe,CAAC,0BAA0B,CAAC,SAkDlG,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GACjC,WAAW,cAAc,GAAG,IAAI,EAChC,+DAA+D,eAAe,CAAC,0BAA0B,CAAC,SAwE3G,CAAA"}
1
+ {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../../src/mutators/operation/operation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAarE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAGlD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,eAAe,GAC1B,gBAAgB,cAAc,GAAG,IAAI,EACrC,SAAS,eAAe,CAAC,4BAA4B,CAAC,KACrD,MAAM,GAAG,SA0DX,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,GAC9B,OAAO,cAAc,GAAG,IAAI,EAC5B,UAAU,iBAAiB,GAAG,IAAI,EAClC,mBAAmB,eAAe,CAAC,uBAAuB,CAAC,SAsB5D,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,yBAAyB,GACpC,UAAU,iBAAiB,GAAG,IAAI,EAClC,OAAO,cAAc,GAAG,IAAI,EAC5B,mEAAmE,eAAe,CAAC,6BAA6B,CAAC,KAChH,IAkGF,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GAC1B,WAAW,cAAc,GAAG,IAAI,EAChC,wBAAwB,eAAe,CAAC,4BAA4B,CAAC,SAgBtE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,GACtC,WAAW,cAAc,GAAG,IAAI,EAChC,uDAAuD,eAAe,CAAC,gCAAgC,CAAC,SAuBzG,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GACjC,WAAW,cAAc,GAAG,IAAI,EAChC,sDAAsD,eAAe,CAAC,0BAA0B,CAAC,SAoDlG,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GACjC,WAAW,cAAc,GAAG,IAAI,EAChC,+DAA+D,eAAe,CAAC,0BAA0B,CAAC,SA0E3G,CAAA"}
@@ -274,8 +274,9 @@ export const deleteOperationExample = (workspace, { meta: { path, method, exampl
274
274
  // Remove the example from all operation parameters
275
275
  operation.parameters?.forEach((parameter) => {
276
276
  const resolvedParameter = getResolvedRef(parameter);
277
- if (!resolvedParameter)
277
+ if (!resolvedParameter) {
278
278
  return;
279
+ }
279
280
  // Remove from content-level examples (if parameter uses content)
280
281
  if ('content' in resolvedParameter && resolvedParameter.content) {
281
282
  Object.values(resolvedParameter.content).forEach((mediaType) => {
@@ -325,8 +326,9 @@ export const renameOperationExample = (workspace, { meta: { path, method, exampl
325
326
  const records = [];
326
327
  operation.parameters?.forEach((parameter) => {
327
328
  const resolvedParameter = getResolvedRef(parameter);
328
- if (!resolvedParameter)
329
+ if (!resolvedParameter) {
329
330
  return;
331
+ }
330
332
  if ('examples' in resolvedParameter && resolvedParameter.examples) {
331
333
  records.push(resolvedParameter.examples);
332
334
  }
@@ -1 +1 @@
1
- {"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../src/mutators/operation/parameters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAMrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAmClD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,iBAAiB,GAAG,IAAI,EAClC,4CAA4C,eAAe,CAAC,4BAA4B,CAAC,SAyG1F,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,8BAA8B,GACzC,UAAU,iBAAiB,GAAG,IAAI,EAClC,uCAAuC,eAAe,CAAC,mCAAmC,CAAC,SA8C5F,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,iBAAiB,GAAG,IAAI,EAClC,6BAA6B,eAAe,CAAC,4BAA4B,CAAC,SAkC3E,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,4BAA4B,GACvC,UAAU,iBAAiB,GAAG,IAAI,EAClC,gBAAgB,eAAe,CAAC,iCAAiC,CAAC,SAgBnE,CAAA"}
1
+ {"version":3,"file":"parameters.d.ts","sourceRoot":"","sources":["../../../src/mutators/operation/parameters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAOrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAmClD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,iBAAiB,GAAG,IAAI,EAClC,4CAA4C,eAAe,CAAC,4BAA4B,CAAC,SA4H1F,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,8BAA8B,GACzC,UAAU,iBAAiB,GAAG,IAAI,EAClC,uCAAuC,eAAe,CAAC,mCAAmC,CAAC,SA8C5F,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,iBAAiB,GAAG,IAAI,EAClC,6BAA6B,eAAe,CAAC,4BAA4B,CAAC,SAkC3E,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,4BAA4B,GACvC,UAAU,iBAAiB,GAAG,IAAI,EAClC,gBAAgB,eAAe,CAAC,iCAAiC,CAAC,SAgBnE,CAAA"}
@@ -3,6 +3,7 @@ import { getParameterExample } from '../../helpers/get-parameter-example.js';
3
3
  import { getResolvedRef } from '../../helpers/get-resolved-ref.js';
4
4
  import { getQuerystringParameter, serializeQuerystringParameter } from '../../helpers/querystring-parameter.js';
5
5
  import { unpackProxyObject } from '../../helpers/unpack-proxy.js';
6
+ import { isParamDisabled } from '../../request-example/builder/header/is-param-disabled.js';
6
7
  import { isOpenApiDocument } from '../../schemas/type-guards.js';
7
8
  import { isContentTypeParameterObject } from '../../schemas/v3.2/strict/type-guards.js';
8
9
  const getPathItemsForParameterMutation = (pathItemRef) => {
@@ -47,6 +48,7 @@ export const upsertOperationParameter = (document, { meta, type, payload, origin
47
48
  const preserveQuerystringValue = querystring && payload.value === serializeQuerystringParameter(querystring);
48
49
  const param = originalParameter;
49
50
  const selected = getParameterExample(param, meta.exampleKey);
51
+ const inheritedDisabled = isParamDisabled(param, selected.example);
50
52
  const target = param.in !== 'querystring' && !selected.serialized && isContentTypeParameterObject(param)
51
53
  ? Object.values(param.content ?? {})[0]
52
54
  : param;
@@ -117,7 +119,27 @@ export const upsertOperationParameter = (document, { meta, type, payload, origin
117
119
  example.value = payload.value;
118
120
  }
119
121
  }
120
- example['x-disabled'] = payload.isDisabled;
122
+ if (payload.propertyState) {
123
+ // Freeze the inherited state before changing values: adding the first populated field
124
+ // must not implicitly enable every untouched sibling.
125
+ const states = { '[]': inheritedDisabled, ...example['x-scalar-disabled-properties'] };
126
+ const { path, previousPath, isDisabled } = payload.propertyState;
127
+ if (previousPath) {
128
+ delete states[JSON.stringify(previousPath)];
129
+ }
130
+ const key = JSON.stringify(path);
131
+ if (isDisabled === undefined) {
132
+ delete states[key];
133
+ }
134
+ else {
135
+ states[key] = isDisabled;
136
+ }
137
+ example['x-scalar-disabled-properties'] = states;
138
+ }
139
+ else {
140
+ example['x-disabled'] = payload.isDisabled;
141
+ delete example['x-scalar-disabled-properties'];
142
+ }
121
143
  return;
122
144
  }
123
145
  // We are adding a new parameter
@@ -1 +1 @@
1
- {"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/mutators/tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AASzD;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,cAAc,GAAG,IAAI,EAAE,SAAS,SAAS,CAAC,gBAAgB,CAAC,SAe3F,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,cAAc,GAAG,IAAI,EAAE,SAAS,SAAS,CAAC,cAAc,CAAC,SAqEvF,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,GAAI,WAAW,cAAc,GAAG,IAAI,EAAE,SAAS,SAAS,CAAC,gBAAgB,CAAC,SAiC/F,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,WAAW;IAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;CAAE;yBAErD,SAAS,CAAC,gBAAgB,CAAC;uBAC7B,SAAS,CAAC,cAAc,CAAC;yBACvB,SAAS,CAAC,gBAAgB,CAAC;CAEnD,CAAA"}
1
+ {"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/mutators/tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AASzD;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,cAAc,GAAG,IAAI,EAAE,SAAS,SAAS,CAAC,gBAAgB,CAAC,SAe3F,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,cAAc,GAAG,IAAI,EAAE,SAAS,SAAS,CAAC,cAAc,CAAC,SAqEvF,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,GAAI,WAAW,cAAc,GAAG,IAAI,EAAE,SAAS,SAAS,CAAC,gBAAgB,CAAC,SAqC/F,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,WAAW;IAAE,KAAK,EAAE,cAAc,GAAG,IAAI,CAAA;CAAE;yBAErD,SAAS,CAAC,gBAAgB,CAAC;uBAC7B,SAAS,CAAC,cAAc,CAAC;yBACvB,SAAS,CAAC,gBAAgB,CAAC;CAEnD,CAAA"}
@@ -112,8 +112,9 @@ export const deleteTag = (workspace, payload) => {
112
112
  Object.values(document.paths ?? {}).forEach((pathItemRef) => {
113
113
  forEachPathItemOperation(pathItemRef, (_method, operationRef) => {
114
114
  const resolvedOperation = getResolvedRef(operationRef);
115
- if (!resolvedOperation)
115
+ if (!resolvedOperation) {
116
116
  return;
117
+ }
117
118
  if ('tags' in resolvedOperation) {
118
119
  const plainTags = unpackProxyObject(resolvedOperation.tags, { depth: 1 });
119
120
  resolvedOperation.tags = plainTags?.filter((tag) => tag !== payload.name);
@@ -124,8 +125,9 @@ export const deleteTag = (workspace, payload) => {
124
125
  Object.values(document.webhooks ?? {}).forEach((pathItemRef) => {
125
126
  forEachPathItemOperation(pathItemRef, (_method, operationRef) => {
126
127
  const resolvedOperation = getResolvedRef(operationRef);
127
- if (!resolvedOperation)
128
+ if (!resolvedOperation) {
128
129
  return;
130
+ }
129
131
  const plainTags = unpackProxyObject(resolvedOperation.tags, { depth: 1 });
130
132
  resolvedOperation.tags = plainTags?.filter((tag) => tag !== payload.name);
131
133
  });
@@ -6,11 +6,12 @@ import { DEFAULT_MODELS_SECTION_LABEL } from '@scalar/types/api-reference';
6
6
  * Extension methods retain exact case because HTTP method tokens are case-sensitive.
7
7
  * Normalizing COPY and copy would collapse distinct operations onto the same anchor.
8
8
  */
9
- const getMethodId = (method) => isHttpMethod(method)
10
- ? method === method.toLowerCase()
11
- ? method.toUpperCase()
12
- : `additionalOperations/${method}`
13
- : method;
9
+ const getMethodId = (method) => {
10
+ if (!isHttpMethod(method)) {
11
+ return method;
12
+ }
13
+ return method === method.toLowerCase() ? method.toUpperCase() : `additionalOperations/${method}`;
14
+ };
14
15
  /**
15
16
  * Returns options for traversing an OpenAPI document, allowing customization of
16
17
  * how IDs and slugs are generated for tags, headings, models, operations, and webhooks.
@@ -0,0 +1,5 @@
1
+ import type { TagsMap } from '../../navigation/types.js';
2
+ import type { OpenApiDocument } from '../../schemas/v3.2/strict/openapi-document.js';
3
+ /** Label tags must not create operation groups, but undeclared tags still do. */
4
+ export declare const getNavigationTagNames: (document: OpenApiDocument, names: string[] | undefined, tagsMap: TagsMap) => string[];
5
+ //# sourceMappingURL=get-navigation-tag-names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-navigation-tag-names.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/get-navigation-tag-names.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAE7E,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,GAChC,UAAU,eAAe,EACzB,OAAO,MAAM,EAAE,GAAG,SAAS,EAC3B,SAAS,OAAO,KACf,MAAM,EAA2F,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { getTagKind } from '../../helpers/get-tag-kind.js';
2
+ /** Label tags must not create operation groups, but undeclared tags still do. */
3
+ export const getNavigationTagNames = (document, names, tagsMap) => names?.filter((name) => getTagKind(document, tagsMap.get(name)?.tag) === 'nav') ?? [];
@@ -1 +1 @@
1
- {"version":3,"file":"traverse-asyncapi-document.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-asyncapi-document.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAyB,gBAAgB,EAA2B,MAAM,4BAA4B,CAAA;AAKlH,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,qCAAqC,CAAA;AAOlG,OAAO,KAAK,EAKV,iBAAiB,EAGlB,MAAM,sBAAsB,CAAA;AAM7B,oFAAoF;AACpF,KAAK,wCAAwC,GAAG,gBAAgB,GAAG;IACjE,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AAiiBD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,GACnC,cAAc,MAAM,EACpB,UAAU,wCAAwC,EAClD,UAAU,iBAAiB,KAC1B,iBA+HF,CAAA"}
1
+ {"version":3,"file":"traverse-asyncapi-document.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-asyncapi-document.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAyB,gBAAgB,EAA2B,MAAM,4BAA4B,CAAA;AAOlH,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,qCAAqC,CAAA;AAOlG,OAAO,KAAK,EAKV,iBAAiB,EAGlB,MAAM,sBAAsB,CAAA;AAM7B,oFAAoF;AACpF,KAAK,wCAAwC,GAAG,gBAAgB,GAAG;IACjE,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AA0iBD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,GACnC,cAAc,MAAM,EACpB,UAAU,wCAAwC,EAClD,UAAU,iBAAiB,KAC1B,iBA+HF,CAAA"}
@@ -1,5 +1,7 @@
1
1
  import { sortByOrder } from '@scalar/helpers/array/sort-by-order';
2
2
  import { objectKeys } from '@scalar/helpers/object/object-keys';
3
+ import { resolveOperationWithTraits } from '../../channel-example/resolve-operation-with-traits.js';
4
+ import { getNameFromRef } from '../../helpers/get-name-from-ref.js';
3
5
  import { getResolvedRef, mergeSiblingReferences } from '../../helpers/get-resolved-ref.js';
4
6
  import { isHidden } from '../../helpers/is-hidden.js';
5
7
  import { unpackProxyObject } from '../../helpers/unpack-proxy.js';
@@ -40,7 +42,7 @@ const getMessageTitle = (message, messageName) => pickNonEmpty(message.title, me
40
42
  /**
41
43
  * Parses a channel JSON pointer (`#/channels/<name>`) into the key used in `document.channels`.
42
44
  */
43
- const getChannelNameFromRef = (ref) => ref.match(/^#\/channels\/([^/]+)$/)?.[1];
45
+ const getChannelNameFromRef = (ref) => getNameFromRef(ref, ['channels']);
44
46
  /**
45
47
  * Resolves the channel referenced by an operation.
46
48
  *
@@ -81,19 +83,16 @@ const resolveOperationMessageNames = (operation, channel, channelName) => {
81
83
  if (operation.messages.length === 0) {
82
84
  return [];
83
85
  }
84
- const channelScopePrefix = `#/channels/${channelName}/messages/`;
85
86
  const names = new Set();
86
87
  for (const messageRef of operation.messages) {
87
88
  if (!('$ref' in messageRef)) {
88
89
  continue;
89
90
  }
90
91
  // Common case: a channel-scoped reference like `#/channels/<name>/messages/<id>`.
91
- if (messageRef.$ref.startsWith(channelScopePrefix)) {
92
- const candidate = messageRef.$ref.slice(channelScopePrefix.length);
93
- if (channelMessages[candidate]) {
94
- names.add(candidate);
95
- continue;
96
- }
92
+ const candidate = getNameFromRef(messageRef.$ref, ['channels', channelName, 'messages']);
93
+ if (candidate && channelMessages[candidate]) {
94
+ names.add(candidate);
95
+ continue;
97
96
  }
98
97
  // Fallback: a channel-level message that points to the same target.
99
98
  for (const [name, entry] of Object.entries(channelMessages)) {
@@ -137,10 +136,10 @@ const sortMessages = (entries) => {
137
136
  entries.sort((a, b) => a.title.localeCompare(b.title));
138
137
  };
139
138
  /**
140
- * Builds nested message entries for one operation.
139
+ * Builds message entries beneath a channel or operation.
141
140
  * Resolves each message ref, skips hidden messages, and sorts the result by title.
142
141
  */
143
- const createMessageEntries = ({ channelName, channel, operationId, messageNames, generateId, }) => {
142
+ const createMessageEntries = ({ channelName, channel, parentId, messageNames, generateId, }) => {
144
143
  const messages = messageNames.flatMap((messageName) => {
145
144
  const messageNode = channel.messages?.[messageName];
146
145
  if (!messageNode) {
@@ -157,7 +156,7 @@ const createMessageEntries = ({ channelName, channel, operationId, messageNames,
157
156
  type: 'asyncapi-message',
158
157
  messageName,
159
158
  channelName,
160
- parentId: operationId,
159
+ parentId,
161
160
  }),
162
161
  title: getMessageTitle(message, messageName),
163
162
  messageName,
@@ -185,7 +184,7 @@ const createOperationEntry = ({ operationName, operation, channel, channelName,
185
184
  const messageEntries = createMessageEntries({
186
185
  channelName,
187
186
  channel,
188
- operationId,
187
+ parentId: operationId,
189
188
  messageNames: resolveOperationMessageNames(operation, channel, channelName),
190
189
  generateId,
191
190
  });
@@ -204,7 +203,7 @@ const createOperationEntry = ({ operationName, operation, channel, channelName,
204
203
  * Builds a channel navigation entry from a bucket and the operations to render under it.
205
204
  * The same channel may appear at the document root and under each of its channel-level tags.
206
205
  * Writes `x-scalar-order` on the source channel (when it is not a bare `$ref`) so other code can reuse the order.
207
- * Returns `undefined` when the channel is hidden or every requested operation was filtered out.
206
+ * Returns `undefined` when the channel is hidden or all its declared operations are hidden.
208
207
  */
209
208
  const createChannelEntry = ({ bucket, operationEntries, generateId, parentId, parentTag, operationsSorter, document, }) => {
210
209
  if (isHidden(bucket.channel)) {
@@ -229,15 +228,26 @@ const createChannelEntry = ({ bucket, operationEntries, generateId, parentId, pa
229
228
  return entry ? [entry] : [];
230
229
  });
231
230
  sortOperations(operations, operationsSorter);
232
- if (operations.length === 0) {
231
+ // A channel with hidden operations must not expose their messages through the fallback.
232
+ if (operations.length === 0 && bucket.operations.length > 0) {
233
233
  return undefined;
234
234
  }
235
+ // Keep channel-only messages reachable without duplicating messages already owned by an operation.
236
+ const operationMessageNames = new Set(bucket.operations.flatMap(({ operation }) => resolveOperationMessageNames(operation, bucket.channel, bucket.channelName)));
237
+ const messages = createMessageEntries({
238
+ channelName: bucket.channelName,
239
+ channel: bucket.channel,
240
+ parentId: channelId,
241
+ messageNames: objectKeys(bucket.channel.messages ?? {}).filter((name) => !operationMessageNames.has(name)),
242
+ generateId,
243
+ });
244
+ const children = [...operations, ...messages];
235
245
  // Persist the rendered order back onto the source channel for downstream consumers.
236
246
  // We skip channels that are stored as references, since the order should live on the target.
237
247
  const channelNode = document.channels?.[bucket.channelName];
238
248
  if (channelNode && !('$ref' in channelNode)) {
239
249
  const orderedChannel = channelNode;
240
- orderedChannel['x-scalar-order'] = operations.map((child) => child.id);
250
+ orderedChannel['x-scalar-order'] = children.map((child) => child.id);
241
251
  }
242
252
  return {
243
253
  type: 'asyncapi-channel',
@@ -245,7 +255,7 @@ const createChannelEntry = ({ bucket, operationEntries, generateId, parentId, pa
245
255
  title: getChannelTitle(bucket.channel, bucket.channelName),
246
256
  channelName: bucket.channelName,
247
257
  channelAddress: bucket.channelAddress,
248
- children: operations,
258
+ children,
249
259
  };
250
260
  };
251
261
  /**
@@ -344,10 +354,7 @@ const collectChannelBuckets = (document) => {
344
354
  if (!operationNode) {
345
355
  continue;
346
356
  }
347
- const operation = getResolvedRef(operationNode, mergeSiblingReferences);
348
- if (isHidden(operation)) {
349
- continue;
350
- }
357
+ const operation = resolveOperationWithTraits(getResolvedRef(operationNode, mergeSiblingReferences));
351
358
  const resolved = resolveOperationChannel(document, operation);
352
359
  if (!resolved) {
353
360
  continue;
@@ -1 +1 @@
1
- {"version":3,"file":"traverse-paths.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-paths.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE5F,OAAO,KAAK,EAA+B,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC3F,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAI9F,eAAO,MAAM,qBAAqB,GAAI,WAAW,eAAe,YAE/D,CAAA;AAsED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,GAAI,sEAM3B;IACD,QAAQ,EAAE,eAAe,CAAA;IACzB,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAA;IAChB,0DAA0D;IAC1D,UAAU,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAA;IAC7C,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,oFAAoF;IACpF,oBAAoB,CAAC,EAAE,oBAAoB,CAAA;CAC5C,KAAG;IAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAA;CA0D7C,CAAA"}
1
+ {"version":3,"file":"traverse-paths.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-paths.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE5F,OAAO,KAAK,EAA+B,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC3F,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAK9F,eAAO,MAAM,qBAAqB,GAAI,WAAW,eAAe,YAE/D,CAAA;AAsED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,GAAI,sEAM3B;IACD,QAAQ,EAAE,eAAe,CAAA;IACzB,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAA;IAChB,0DAA0D;IAC1D,UAAU,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAA;IAC7C,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,oFAAoF;IACpF,oBAAoB,CAAC,EAAE,oBAAoB,CAAA;CAC5C,KAAG;IAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAA;CA2D7C,CAAA"}
@@ -4,6 +4,7 @@ import { getResolvedRef, mergeSiblingReferences } from '../../helpers/get-resolv
4
4
  import { isHidden } from '../../helpers/is-hidden.js';
5
5
  import { traverseOperationExamples } from '../../navigation/helpers/traverse-examples.js';
6
6
  import { XScalarStabilityValues } from '../../schemas/extensions/operation/index.js';
7
+ import { getNavigationTagNames } from './get-navigation-tag-names.js';
7
8
  import { getTag } from './get-tag.js';
8
9
  export const isDeprecatedOperation = (operation) => {
9
10
  return operation.deprecated || operation['x-scalar-stability'] === XScalarStabilityValues.Deprecated;
@@ -29,7 +30,7 @@ const createOperationEntry = ({ ref, operation, method, path, generateId, parent
29
30
  path: path,
30
31
  parentId: parentId,
31
32
  });
32
- const title = operationTitleSource === 'path' ? path : operation.summary?.trim() ? operation.summary : path;
33
+ const title = operationTitleSource !== 'path' && operation.summary?.trim() ? operation.summary : path;
33
34
  const isDeprecated = isDeprecatedOperation(operation);
34
35
  const examples = traverseOperationExamples(operation).map((example) => ({
35
36
  type: 'example',
@@ -85,8 +86,9 @@ export const traversePaths = ({ document, tagsMap, generateId, documentId, opera
85
86
  }
86
87
  const ref = `#/paths/${escapeJsonPointer(path)}/${getPathItemOperationKey(method)}`;
87
88
  // Traverse tags
88
- if (operation.tags?.length) {
89
- operation.tags.forEach((tagName) => {
89
+ const navigationTags = getNavigationTagNames(document, operation.tags, tagsMap);
90
+ if (navigationTags.length) {
91
+ navigationTags.forEach((tagName) => {
90
92
  const { tag, id: tagId } = getTag({
91
93
  tagsMap,
92
94
  name: tagName,
@@ -1 +1 @@
1
- {"version":3,"file":"traverse-schemas.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-schemas.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,KAAK,EAAa,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,wCAAwC,CAAA;AA2C3F;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,gDAK7B;IACD,QAAQ,EAAE,eAAe,CAAA;IACzB,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAA;IAC7C,UAAU,EAAE,MAAM,CAAA;CACnB,KAAG,eAAe,EAkDlB,CAAA"}
1
+ {"version":3,"file":"traverse-schemas.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-schemas.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,KAAK,EAAa,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,wCAAwC,CAAA;AA2C3F;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,gDAK7B;IACD,QAAQ,EAAE,eAAe,CAAA;IACzB,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAA;IAC7C,UAAU,EAAE,MAAM,CAAA;CACnB,KAAG,eAAe,EAmDlB,CAAA"}
@@ -1,5 +1,7 @@
1
+ import { isObject } from '@scalar/helpers/object/is-object';
1
2
  import { getResolvedRef, mergeSiblingReferences } from '../../helpers/get-resolved-ref.js';
2
3
  import { isHidden } from '../../helpers/is-hidden.js';
4
+ import { getNavigationTagNames } from '../../navigation/helpers/get-navigation-tag-names.js';
3
5
  import { getTag } from '../../navigation/helpers/get-tag.js';
4
6
  /** Creates a traversed schema entry from an OpenAPI schema object.
5
7
  *
@@ -14,7 +16,7 @@ const createSchemaEntry = ({ ref, name, generateId, parentTag, _schema, parentId
14
16
  const schema = getResolvedRef(_schema);
15
17
  // Use schema.title if available, otherwise fall back to name
16
18
  // @see https://json-schema.org/draft/2020-12/json-schema-core#section-4.3.5
17
- const title = (schema && 'title' in schema && schema.title) || name;
19
+ const title = (isObject(schema) && 'title' in schema && schema.title) || name;
18
20
  const entry = {
19
21
  id,
20
22
  title,
@@ -46,8 +48,9 @@ export const traverseSchemas = ({ document, tagsMap, generateId, documentId, })
46
48
  }
47
49
  const ref = `#/components/schemas/${name}`;
48
50
  // Add to tags
49
- if (schema?.['x-tags']) {
50
- schema['x-tags'].forEach((tagName) => {
51
+ const navigationTags = getNavigationTagNames(document, schema?.['x-tags'], tagsMap);
52
+ if (navigationTags.length) {
53
+ navigationTags.forEach((tagName) => {
51
54
  const { tag, id: tagId } = getTag({ tagsMap, name: tagName, documentId, generateId });
52
55
  tagsMap.get(tagName)?.entries.push(createSchemaEntry({
53
56
  ref,
@@ -1 +1 @@
1
- {"version":3,"file":"traverse-tags.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-tags.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,sBAAsB,CAAA;AACxE,OAAO,KAAK,EAAE,eAAe,EAAa,MAAM,wCAAwC,CAAA;AAIxF,KAAK,OAAO,GAAG,IAAI,CAAC,mBAAmB,EAAE,YAAY,GAAG,kBAAkB,GAAG,YAAY,CAAC,CAAA;AAiS1F;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GAAI,2FAK1B;IACD,QAAQ,EAAE,eAAe,CAAA;IACzB,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;CACjB,KAAG,cAAc,EAoEjB,CAAA"}
1
+ {"version":3,"file":"traverse-tags.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-tags.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,sBAAsB,CAAA;AACxE,OAAO,KAAK,EAAE,eAAe,EAAa,MAAM,wCAAwC,CAAA;AAIxF,KAAK,OAAO,GAAG,IAAI,CAAC,mBAAmB,EAAE,YAAY,GAAG,kBAAkB,GAAG,YAAY,CAAC,CAAA;AAmS1F;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GAAI,2FAK1B;IACD,QAAQ,EAAE,eAAe,CAAA;IACzB,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;CACjB,KAAG,cAAc,EAuEjB,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { sortByOrder } from '@scalar/helpers/array/sort-by-order';
2
+ import { getTagKind } from '../../helpers/get-tag-kind.js';
2
3
  import { isHidden } from '../../helpers/is-hidden.js';
3
4
  import { unpackProxyObject } from '../../helpers/unpack-proxy.js';
4
5
  import { getXKeysFromObject } from '../../navigation/helpers/get-x-keys.js';
@@ -57,7 +58,7 @@ const createTagEntry = ({ tag, generateId, children, isGroup = false, isTagGroup
57
58
  * @returns Array of processed and sorted tag entries
58
59
  */
59
60
  /** Sorts tags and returns entries */
60
- const getSortedTagEntries = ({ _keys, tagsMap, options: { tagsSorter, operationsSorter, generateId }, documentId, sortOrder, }) => {
61
+ const getSortedTagEntries = ({ _keys, document, tagsMap, options: { tagsSorter, operationsSorter, generateId }, documentId, sortOrder, }) => {
61
62
  /**
62
63
  * Process each tag and its entries:
63
64
  * - Skip internal and ignored tags
@@ -67,7 +68,7 @@ const getSortedTagEntries = ({ _keys, tagsMap, options: { tagsSorter, operations
67
68
  const entries = _keys.flatMap((key) => {
68
69
  const { tag, entries } = getTag({ tagsMap, name: key, documentId, generateId });
69
70
  // Skip if the tag is internal or scalar-ignore
70
- if (isHidden(tag)) {
71
+ if (isHidden(tag) || getTagKind(document, tag) !== 'nav') {
71
72
  return [];
72
73
  }
73
74
  const sortOrder = tag['x-scalar-order'];
@@ -167,7 +168,7 @@ const nestTagsByParent = ({ flatEntries, document, originalOrders, }) => {
167
168
  hadOwnOperations.set(entry.name, (entry.children?.length ?? 0) > 0);
168
169
  }
169
170
  }
170
- const parentOf = getParentMap(document.tags ?? []);
171
+ const parentOf = getParentMap((document.tags ?? []).filter((tag) => getTagKind(document, tag) === 'nav'));
171
172
  // Re-parent entries by reference, tracking which ones leave the top level.
172
173
  const nested = new Set();
173
174
  const gainedNestedTags = new Set();
@@ -232,7 +233,7 @@ export const traverseTags = ({ document, tagsMap, documentId, options: { generat
232
233
  // Native OpenAPI 3.2 tag nesting via `parent` takes precedence over x-tagGroups, but only
233
234
  // when at least one `parent` resolves to another declared tag outside a circular reference.
234
235
  // A stray or misspelled `parent` value must not disable the legacy `x-tagGroups` handling.
235
- const parentOf = getParentMap(document.tags ?? []);
236
+ const parentOf = getParentMap((document.tags ?? []).filter((tag) => getTagKind(document, tag) === 'nav'));
236
237
  const hasNestedTags = Array.from(parentOf.keys()).some((name) => !isCyclic(parentOf, name));
237
238
  if (hasNestedTags) {
238
239
  // The flat traversal rewrites tag-level `x-scalar-order`, so capture the original values
@@ -244,6 +245,7 @@ export const traverseTags = ({ document, tagsMap, documentId, options: { generat
244
245
  }
245
246
  }
246
247
  const flatEntries = getSortedTagEntries({
248
+ document,
247
249
  _keys: Array.from(tagsMap.keys()),
248
250
  tagsMap,
249
251
  options: { generateId, tagsSorter, operationsSorter },
@@ -257,6 +259,7 @@ export const traverseTags = ({ document, tagsMap, documentId, options: { generat
257
259
  const tagGroups = document['x-tagGroups'];
258
260
  return tagGroups.flatMap((tagGroup) => {
259
261
  const entries = getSortedTagEntries({
262
+ document,
260
263
  _keys: tagGroup.tags,
261
264
  tagsMap,
262
265
  options: { tagsSorter, operationsSorter, generateId },
@@ -280,6 +283,7 @@ export const traverseTags = ({ document, tagsMap, documentId, options: { generat
280
283
  // Ungrouped regular tags
281
284
  const keys = Array.from(tagsMap.keys());
282
285
  const tags = getSortedTagEntries({
286
+ document,
283
287
  _keys: keys,
284
288
  tagsMap,
285
289
  options: { generateId, tagsSorter, operationsSorter },
@@ -1 +1 @@
1
- {"version":3,"file":"traverse-webhooks.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-webhooks.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,KAAK,EAAa,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAA8B,MAAM,wCAAwC,CAAA;AA2DzG;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,GAAI,0EAM9B;IACD,uBAAuB;IACvB,QAAQ,EAAE,eAAe,CAAA;IACzB,6CAA6C;IAC7C,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAA;IAC7C,wBAAwB,EAAE,MAAM,CAAA;IAChC,UAAU,EAAE,MAAM,CAAA;CACnB,KAAG,gBAAgB,EAuDnB,CAAA"}
1
+ {"version":3,"file":"traverse-webhooks.d.ts","sourceRoot":"","sources":["../../../src/navigation/helpers/traverse-webhooks.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACtE,OAAO,KAAK,EAAa,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,eAAe,EAA8B,MAAM,wCAAwC,CAAA;AA4DzG;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,GAAI,0EAM9B;IACD,uBAAuB;IACvB,QAAQ,EAAE,eAAe,CAAA;IACzB,6CAA6C;IAC7C,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,mBAAmB,CAAC,YAAY,CAAC,CAAA;IAC7C,wBAAwB,EAAE,MAAM,CAAA;IAChC,UAAU,EAAE,MAAM,CAAA;CACnB,KAAG,gBAAgB,EAwDnB,CAAA"}
@@ -2,6 +2,7 @@ import { forEachPathItemOperation, getPathItemOperationKey } from '../../helpers
2
2
  import { getResolvedRef, mergeSiblingReferences } from '../../helpers/get-resolved-ref.js';
3
3
  import { isHidden } from '../../helpers/is-hidden.js';
4
4
  import { isDeprecatedOperation } from '../../navigation/helpers/traverse-paths.js';
5
+ import { getNavigationTagNames } from './get-navigation-tag-names.js';
5
6
  import { getTag } from './get-tag.js';
6
7
  /** Creates a traversed webhook entry from an OpenAPI webhook object.
7
8
  *
@@ -63,8 +64,9 @@ export const traverseWebhooks = ({ document, tagsMap, generateId, untaggedWebhoo
63
64
  return;
64
65
  }
65
66
  const ref = `#/webhooks/${name}/${getPathItemOperationKey(method)}`;
66
- if (operation.tags?.length) {
67
- operation.tags.forEach((tagName) => {
67
+ const navigationTags = getNavigationTagNames(document, operation.tags, tagsMap);
68
+ if (navigationTags.length) {
69
+ navigationTags.forEach((tagName) => {
68
70
  const { tag, id: tagId } = getTag({ tagsMap, name: tagName, documentId, generateId });
69
71
  tagsMap.get(tagName)?.entries.push(createWebhookEntry({
70
72
  ref,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/bundler/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,KAAK,eAAe,EAAwB,MAAM,2BAA2B,CAAA;AAStF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,QAAO,eAahC,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,KAAG,eA2CpE,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,QAAO,eAwCjC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,mBAAmB,QAAO,eA6BtC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,oBAAoB,QAAO,eAuBvC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,QAAO,eAyBhC,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,QAAO,eAmFrC,CAAA;AAKD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QAAO,eAaxC,CAAA;AAED,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/bundler/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,KAAK,eAAe,EAAwB,MAAM,2BAA2B,CAAA;AAStF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,QAAO,eAahC,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,KAAG,eA6CpE,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,QAAO,eAwCjC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,mBAAmB,QAAO,eA6BtC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,oBAAoB,QAAO,eAuBvC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,QAAO,eAyBhC,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,QAAO,eAmFrC,CAAA;AAKD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QAAO,eAaxC,CAAA;AAED,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA"}
@@ -57,8 +57,9 @@ export const externalValueResolver = (options) => {
57
57
  const resolvedValue = resolveReferencePath(context.origin, externalValue);
58
58
  if (options?.lazy) {
59
59
  const path = context.path.at(-2) === 'examples' ? context.path : (context.referencedFromPath ?? context.path);
60
- if (path.at(-2) !== 'examples' || isSchemaPath(path))
60
+ if (path.at(-2) !== 'examples' || isSchemaPath(path)) {
61
61
  return;
62
+ }
62
63
  // Preserve the referenced document origin before bundling loses that context.
63
64
  node['externalValue'] = resolvedValue;
64
65
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"openapi-document.d.ts","sourceRoot":"","sources":["../../../src/plugins/bundler/openapi-document.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAwB,MAAM,2BAA2B,CAAA;AAE7G,uFAAuF;AACvF,eAAO,MAAM,sBAAsB,EAAE,gBAcpC,CAAA;AAED,8FAA8F;AAC9F,eAAO,MAAM,eAAe,QAAO,eAsClC,CAAA"}
1
+ {"version":3,"file":"openapi-document.d.ts","sourceRoot":"","sources":["../../../src/plugins/bundler/openapi-document.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAwB,MAAM,2BAA2B,CAAA;AAE7G,uFAAuF;AACvF,eAAO,MAAM,sBAAsB,EAAE,gBAcpC,CAAA;AAED,8FAA8F;AAC9F,eAAO,MAAM,eAAe,QAAO,eAwClC,CAAA"}
@@ -19,8 +19,9 @@ export const openApiDocument = () => {
19
19
  const authoredRefs = new WeakMap();
20
20
  const paths = new WeakMap();
21
21
  const indexPaths = (value, path) => {
22
- if (value === null || typeof value !== 'object' || paths.has(value))
22
+ if (value === null || typeof value !== 'object' || paths.has(value)) {
23
23
  return;
24
+ }
24
25
  paths.set(value, path);
25
26
  for (const [key, child] of Object.entries(value)) {
26
27
  indexPaths(child, [...path, key]);
@@ -1 +1 @@
1
- {"version":3,"file":"build-multipart.d.ts","sourceRoot":"","sources":["../../../../src/request-example/builder/body/build-multipart.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,eAAe,EACf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAQrE,sGAAsG;AACtG,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC,GAAG,CACA;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,IAAI,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,IAAI,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,aAAa,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CACrE,CAAA;AAED,mFAAmF;AACnF,eAAO,MAAM,qBAAqB,GAAI,aAAa,MAAM,EAAE,OAAO,eAAe,KAAG,OASnF,CAAA;AAED,4EAA4E;AAC5E,eAAO,MAAM,sBAAsB,GAAI,aAAa,MAAM,EAAE,OAAO,eAAe,KAAG,OASpF,CAAA;AA4CD,sFAAsF;AACtF,eAAO,MAAM,sBAAsB,GACjC,QAAQ,YAAY,GAAG,SAAS,EAChC,OAAO,MAAM,EACb,aAAa,eAAe,CAAC,YAAY,CAAC,KACzC,YAAY,GAAG,SAMa,CAAA;AAc/B,6FAA6F;AAC7F,eAAO,MAAM,cAAc,GACzB,OAAO,OAAO,EACd,aAAa,MAAM,EACnB,WAAU,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,gBAAgB,GAAG,cAAc,GAAG,YAAY,CAAM,EACnG,SAAS,YAAY,EACrB,gBAAW,KACV,aAAa,EAkIf,CAAA"}
1
+ {"version":3,"file":"build-multipart.d.ts","sourceRoot":"","sources":["../../../../src/request-example/builder/body/build-multipart.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,eAAe,EACf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAQrE,sGAAsG;AACtG,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC,GAAG,CACA;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,IAAI,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,IAAI,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,aAAa,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CACrE,CAAA;AAED,mFAAmF;AACnF,eAAO,MAAM,qBAAqB,GAAI,aAAa,MAAM,EAAE,OAAO,eAAe,KAAG,OASnF,CAAA;AAED,4EAA4E;AAC5E,eAAO,MAAM,sBAAsB,GAAI,aAAa,MAAM,EAAE,OAAO,eAAe,KAAG,OASpF,CAAA;AA4CD,sFAAsF;AACtF,eAAO,MAAM,sBAAsB,GACjC,QAAQ,YAAY,GAAG,SAAS,EAChC,OAAO,MAAM,EACb,aAAa,eAAe,CAAC,YAAY,CAAC,KACzC,YAAY,GAAG,SAMa,CAAA;AAc/B,6FAA6F;AAC7F,eAAO,MAAM,cAAc,GACzB,OAAO,OAAO,EACd,aAAa,MAAM,EACnB,WAAU,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,gBAAgB,GAAG,cAAc,GAAG,YAAY,CAAM,EACnG,SAAS,YAAY,EACrB,gBAAW,KACV,aAAa,EAmIf,CAAA"}
@@ -83,8 +83,9 @@ export const buildMultipart = (value, contentType, encoding = {}, schema, nestin
83
83
  }
84
84
  const named = parseMimeType(contentType).essence === 'multipart/form-data';
85
85
  const positional = Array.isArray(value);
86
- const entries = positional
87
- ? value.map((item, index) => {
86
+ let entries = [];
87
+ if (positional) {
88
+ entries = value.map((item, index) => {
88
89
  const itemEncoding = index < (encoding.prefixEncoding?.length ?? 0) ? encoding.prefixEncoding?.[index] : encoding.itemEncoding;
89
90
  const itemSchema = getMultipartItemSchema(schema, index, encoding.itemSchema);
90
91
  if (named && item !== null && typeof item === 'object' && !Array.isArray(item)) {
@@ -97,20 +98,21 @@ export const buildMultipart = (value, contentType, encoding = {}, schema, nestin
97
98
  return [entry[0], entry[1], itemEncoding, resolveLeafSchema(itemSchema, [entry[0]])];
98
99
  }
99
100
  return [undefined, item, itemEncoding, itemSchema];
100
- })
101
- : value !== null && typeof value === 'object'
102
- ? Object.entries(value).flatMap(([key, item]) => {
103
- const propertySchema = resolveLeafSchema(schema, [key]);
104
- return (Array.isArray(item) ? item : [item]).map((part) => [
105
- key,
106
- part,
107
- encoding.encoding?.[key],
108
- Array.isArray(item)
109
- ? getResolvedRef(propertySchema && isArraySchema(propertySchema) ? propertySchema.items : undefined, mergeSiblingReferences)
110
- : propertySchema,
111
- ]);
112
- })
113
- : [];
101
+ });
102
+ }
103
+ else if (value !== null && typeof value === 'object') {
104
+ entries = Object.entries(value).flatMap(([key, item]) => {
105
+ const propertySchema = resolveLeafSchema(schema, [key]);
106
+ return (Array.isArray(item) ? item : [item]).map((part) => [
107
+ key,
108
+ part,
109
+ encoding.encoding?.[key],
110
+ Array.isArray(item)
111
+ ? getResolvedRef(propertySchema && isArraySchema(propertySchema) ? propertySchema.items : undefined, mergeSiblingReferences)
112
+ : propertySchema,
113
+ ]);
114
+ });
115
+ }
114
116
  return entries.flatMap(([key, item, partEncoding, partSchema]) => {
115
117
  const style = named && hasEncodingStyle(partEncoding);
116
118
  const styleParts = style ? serializeFormPropertyWithEncoding(key ?? '', item, partEncoding) : null;
@@ -1 +1 @@
1
- {"version":3,"file":"build-request-body.d.ts","sourceRoot":"","sources":["../../../../src/request-example/builder/body/build-request-body.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0DAA0D,CAAA;AAKjG,OAAO,EACL,KAAK,aAAa,EAKnB,MAAM,mBAAmB,CAAA;AAO1B,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,EAAE,CACH;QACE,IAAI,EAAE,MAAM,CAAA;QACZ,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;QACb,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,GACD;QACE,IAAI,EAAE,MAAM,CAAA;QACZ,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,IAAI,CAAA;QACX,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,GACD;QACE,IAAI,EAAE,MAAM,CAAA;QACZ,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,IAAI,CAAA;QACX,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,CACJ,EAAE,CAAA;CACJ,CAAA;AAwBD,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,YAAY,CAAA;IAClB,KAAK,EAAE;QACL,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;KACd,EAAE,CAAA;CACJ,CAAA;AAED,KAAK,GAAG,GAAG;IACT,IAAI,EAAE,KAAK,CAAA;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,UAAU,GACV,GAAG,GACH;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,aAAa,EAAE,CAAA;CAAE,CAAA;AA2CtE;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,aAAa,iBAAiB,GAAG,SAAS;AAC1C,qCAAqC;AACrC,oBAAuB;AACvB,sEAAsE;AACtE,kCAAkC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACxD,iBAAiB,MAAM,KACtB,WAAW,GAAG,IAoXhB,CAAA"}
1
+ {"version":3,"file":"build-request-body.d.ts","sourceRoot":"","sources":["../../../../src/request-example/builder/body/build-request-body.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0DAA0D,CAAA;AAMjG,OAAO,EACL,KAAK,aAAa,EAKnB,MAAM,mBAAmB,CAAA;AAO1B,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,EAAE,CACH;QACE,IAAI,EAAE,MAAM,CAAA;QACZ,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;QACb,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,GACD;QACE,IAAI,EAAE,MAAM,CAAA;QACZ,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,IAAI,CAAA;QACX,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,GACD;QACE,IAAI,EAAE,MAAM,CAAA;QACZ,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,IAAI,CAAA;QACX,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,CACJ,EAAE,CAAA;CACJ,CAAA;AAwBD,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,YAAY,CAAA;IAClB,KAAK,EAAE;QACL,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;KACd,EAAE,CAAA;CACJ,CAAA;AAED,KAAK,GAAG,GAAG;IACT,IAAI,EAAE,KAAK,CAAA;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,UAAU,GACV,GAAG,GACH;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,aAAa,EAAE,CAAA;CAAE,CAAA;AA2CtE;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAC3B,aAAa,iBAAiB,GAAG,SAAS;AAC1C,qCAAqC;AACrC,oBAAuB;AACvB,sEAAsE;AACtE,kCAAkC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACxD,iBAAiB,MAAM,KACtB,WAAW,GAAG,IAiXhB,CAAA"}
@@ -2,10 +2,10 @@
2
2
  import { parseMimeType } from '@scalar/helpers/http/mime-type';
3
3
  import { isObject } from '@scalar/helpers/object/is-object';
4
4
  import { setValueAtPath } from '@scalar/helpers/object/set-value-at-path';
5
- import { getResolvedRef, mergeSiblingReferences } from '@scalar/workspace-store/helpers/get-resolved-ref';
6
5
  import { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy';
7
6
  import { isObjectSchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards';
8
7
  import { getExampleValue, getExplicitExampleText } from '../../../helpers/get-example-value.js';
8
+ import { resolveFormSchema } from '../../../helpers/resolve-form-schema.js';
9
9
  import { buildMultipart, getMultipartItemSchema, isPositionalMultipart, needsMultipartEncoding, } from './build-multipart.js';
10
10
  import { getExampleFromBody } from './get-request-body-example.js';
11
11
  import { getSelectedBodyContentType } from './get-selected-body-content-type.js';
@@ -90,7 +90,7 @@ requestBodyCompositionSelection, openapiVersion) => {
90
90
  // object schema that declares it outside `required`, so undeclared and required keys are
91
91
  // always kept. This mirrors the unchecked-by-default checkbox in the Test Request panel.
92
92
  // The array (edited) form path is unaffected: it carries its own per-row `isDisabled`.
93
- const resolvedBodySchema = getResolvedRef(requestBody.content[bodyContentType]?.schema, mergeSiblingReferences);
93
+ const resolvedBodySchema = resolveFormSchema(requestBody.content[bodyContentType]?.schema, requestBodyCompositionSelection);
94
94
  const objectBodySchema = resolvedBodySchema && isObjectSchema(resolvedBodySchema) ? resolvedBodySchema : undefined;
95
95
  // Composition (allOf/oneOf/anyOf) can mark a property required inside a subschema we do not
96
96
  // merge here, so skip dropping entirely for composed schemas rather than risk removing an
@@ -171,9 +171,7 @@ requestBodyCompositionSelection, openapiVersion) => {
171
171
  // lazily allocate the regrouped object for its top-level key and push it into
172
172
  // `entries` at the position of the *first* matching row, then keep folding leaves
173
173
  // into the same live object reference so interleaved flat rows keep their order.
174
- const multipartSchema = result.mode === 'formdata'
175
- ? getResolvedRef(requestBody.content[bodyContentType]?.schema, mergeSiblingReferences)
176
- : undefined;
174
+ const multipartSchema = result.mode === 'formdata' ? resolvedBodySchema : undefined;
177
175
  const entries = result.mode === 'formdata' ? regroupMultipartRows(exampleValue, multipartSchema) : exampleValue;
178
176
  // Loop over all entries and add them to the form
179
177
  entries.forEach(({ name, value }) => {