@scalar/schemas 0.13.2 → 0.15.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @scalar/schemas
2
2
 
3
+ ## 0.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#10697](https://github.com/scalar/scalar/pull/10697): Add `urlRouting: false` to keep API reference navigation in internal state without reading or changing the host page URL.
8
+
9
+ ## 0.14.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#10213](https://github.com/scalar/scalar/pull/10213): Add per-reference Markdown rendering hooks and an explicitly loaded Mermaid plugin with interactive diagrams, keyboard panning, and zoom controls.
14
+
15
+ Provide Markdown hooks before mounting the embedded client modal so its initial render receives the configured hooks. The Mermaid viewer uses customizable Scalar theme styles and an intentional light drawing surface.
16
+
17
+ Isolate Markdown plugin cleanup failures so other plugins still release their resources when content changes or unmounts.
18
+
19
+ ### Patch Changes
20
+
21
+ - [#10597](https://github.com/scalar/scalar/pull/10597): Render AsyncAPI string discriminators with inherited schema variants and effective discriminator values.
22
+
3
23
  ## 0.13.2
4
24
 
5
25
  ### Patch Changes
@@ -84,6 +84,7 @@ export declare const apiReferenceConfigurationSchema: import("@scalar/validation
84
84
  onDestroy: import("@scalar/validation").OptionalSchema<import("@scalar/validation").FunctionSchema<() => void>>;
85
85
  }>>;
86
86
  apiClientPlugins: any[];
87
+ markdown?: import("@scalar/helpers/markdown/markdown-render-hook").MarkdownRenderHook;
87
88
  }>>>;
88
89
  pluginUrls: import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").StringSchema>>;
89
90
  isEditable: import("@scalar/validation").BooleanSchema;
@@ -133,6 +134,7 @@ export declare const apiReferenceConfigurationSchema: import("@scalar/validation
133
134
  }) => Response | void | Promise<Response | void>>>;
134
135
  onShowMore: import("@scalar/validation").OptionalSchema<import("@scalar/validation").FunctionSchema<(tagId: string) => Promise<void> | void>>;
135
136
  onSidebarClick: import("@scalar/validation").OptionalSchema<import("@scalar/validation").FunctionSchema<(href: string) => Promise<void> | void>>;
137
+ urlRouting: import("@scalar/validation").OptionalSchema<import("@scalar/validation").BooleanSchema>;
136
138
  pathRouting: import("@scalar/validation").OptionalSchema<import("@scalar/validation").ObjectSchema<{
137
139
  basePath: import("@scalar/validation").StringSchema;
138
140
  }>>;
@@ -288,6 +290,7 @@ export declare const apiReferenceConfigurationWithSourceSchema: (rawInput: unkno
288
290
  onDestroy: import("@scalar/validation").OptionalSchema<import("@scalar/validation").FunctionSchema<() => void>>;
289
291
  }>>;
290
292
  apiClientPlugins: any[];
293
+ markdown?: import("@scalar/helpers/markdown/markdown-render-hook").MarkdownRenderHook;
291
294
  })[] | undefined;
292
295
  pluginUrls?: string[] | undefined;
293
296
  modelsSectionLabel?: string | undefined;
@@ -329,6 +332,7 @@ export declare const apiReferenceConfigurationWithSourceSchema: (rawInput: unkno
329
332
  }) => Response | void | Promise<Response | void>) | undefined;
330
333
  onShowMore?: ((tagId: string) => Promise<void> | void) | undefined;
331
334
  onSidebarClick?: ((href: string) => Promise<void> | void) | undefined;
335
+ urlRouting?: boolean | undefined;
332
336
  pathRouting?: {
333
337
  basePath: string;
334
338
  } | undefined;
@@ -472,6 +476,7 @@ export declare const apiReferenceConfigurationWithSourceSchema: (rawInput: unkno
472
476
  onDestroy: import("@scalar/validation").OptionalSchema<import("@scalar/validation").FunctionSchema<() => void>>;
473
477
  }>>;
474
478
  apiClientPlugins: any[];
479
+ markdown?: import("@scalar/helpers/markdown/markdown-render-hook").MarkdownRenderHook;
475
480
  })[] | undefined;
476
481
  pluginUrls?: string[] | undefined;
477
482
  modelsSectionLabel?: string | undefined;
@@ -513,6 +518,7 @@ export declare const apiReferenceConfigurationWithSourceSchema: (rawInput: unkno
513
518
  }) => Response | void | Promise<Response | void>) | undefined;
514
519
  onShowMore?: ((tagId: string) => Promise<void> | void) | undefined;
515
520
  onSidebarClick?: ((href: string) => Promise<void> | void) | undefined;
521
+ urlRouting?: boolean | undefined;
516
522
  pathRouting?: {
517
523
  basePath: string;
518
524
  } | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"api-reference-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-configuration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,QAAQ,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjF,OAAO,EACL,KAAK,aAAa,EAenB,MAAM,oBAAoB,CAAA;AAO3B,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAwHF,aAAa,CAAC,QAAQ,CAAC;mBACvB,aAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;;;;oHAYnC,MAAM,KAAK,IAAI;oHAGf,IAAI;6GAGX,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;qHAKhD;QACN,OAAO,EAAE,OAAO,CAAA;QAChB,cAAc,EAAE,OAAO,CAAA;QACvB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KACrC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;oHASlB;QACN,OAAO,EAAE,OAAO,CAAA;QAChB,cAAc,EAAE,OAAO,CAAA;QACvB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KACrC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;wHAQjB;QAAE,QAAQ,EAAE,QAAQ,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,QAAQ,GAAG,IAAI,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;gHAKpE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;mHAG5B,MAAM,KAAK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AAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM;qCAIpD;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM;mCAKvD;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM;4BAGnD;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,KAAK,MAAM;wBAG3E,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS;gCA2Cb,GAAG,KAAK,GAAG,KAAK,MAAM;iDAGG,GAAG,KAAK,GAAG,KAAK,MAAM;kBA6FvG,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { DEFAULT_MODELS_SECTION_LABEL } from '@scalar/types/api-reference';
2
2
  import { any, array, boolean, coerce, evaluate, fn, intersection, literal, number, object, optional, record, string, union, } from '@scalar/validation';
3
- import { apiReferencePluginSchema } from '../api-reference/api-reference-plugin.js';
3
+ import { apiReferencePluginSchema } from './api-reference-plugin.js';
4
4
  import { baseConfigurationSchema } from './base-configuration.js';
5
5
  import { sourceConfigurationSchema } from './source-configuration.js';
6
6
  export const apiReferenceConfigurationSchema = intersection([
@@ -141,6 +141,9 @@ export const apiReferenceConfigurationSchema = intersection([
141
141
  onSidebarClick: optional(fn(), {
142
142
  typeComment: 'onSidebarClick is fired when the user clicks on a sidebar item',
143
143
  }),
144
+ urlRouting: optional(boolean(), {
145
+ typeComment: 'Sync navigation with the browser URL. Set to false for embedded references that must leave the host URL and history alone. Defaults to true.',
146
+ }),
144
147
  pathRouting: optional(object({
145
148
  basePath: string(),
146
149
  }), {
@@ -1,3 +1,4 @@
1
+ import type { MarkdownRenderHook } from '@scalar/helpers/markdown/markdown-render-hook';
1
2
  import { type Static } from '@scalar/validation';
2
3
  declare const openApiExtensionSchema: import("@scalar/validation").ObjectSchema<{
3
4
  name: import("@scalar/validation").StringSchema;
@@ -41,6 +42,7 @@ export declare const apiReferencePluginSchema: import("@scalar/validation").Func
41
42
  views: Static<typeof viewsSchema>;
42
43
  hooks: Static<typeof lifecycleHooksSchema>;
43
44
  apiClientPlugins: any[];
45
+ markdown?: MarkdownRenderHook;
44
46
  }>;
45
47
  export {};
46
48
  //# sourceMappingURL=api-reference-plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-reference-plugin.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAsE,MAAM,oBAAoB,CAAA;AAEpH,QAAA,MAAM,sBAAsB;;;;EAY1B,CAAA;AAyBF,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;EAOf,CAAA;AAEF,QAAA,MAAM,oBAAoB;uHACe;QAAE,MAAM,EAAE,GAAG,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE,KAAK,IAAI;+HAC3B;QAAE,MAAM,EAAE,GAAG,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE,KAAK,IAAI;6GACrD,IAAI;EACjC,CAAA;AAEF,eAAO,MAAM,wBAAwB,oDAE3B;IACJ,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAC,OAAO,sBAAsB,CAAC,EAAE,CAAA;IACnD,KAAK,EAAE,MAAM,CAAC,OAAO,WAAW,CAAC,CAAA;IACjC,KAAK,EAAE,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAA;IAC1C,gBAAgB,EAAE,GAAG,EAAE,CAAA;CACxB,CACA,CAAA"}
1
+ {"version":3,"file":"api-reference-plugin.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAA;AACvF,OAAO,EAAE,KAAK,MAAM,EAAsE,MAAM,oBAAoB,CAAA;AAEpH,QAAA,MAAM,sBAAsB;;;;EAY1B,CAAA;AAyBF,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;EAOf,CAAA;AAEF,QAAA,MAAM,oBAAoB;uHACe;QAAE,MAAM,EAAE,GAAG,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE,KAAK,IAAI;+HAC3B;QAAE,MAAM,EAAE,GAAG,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE,KAAK,IAAI;6GACrD,IAAI;EACjC,CAAA;AAEF,eAAO,MAAM,wBAAwB,oDAE3B;IACJ,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAC,OAAO,sBAAsB,CAAC,EAAE,CAAA;IACnD,KAAK,EAAE,MAAM,CAAC,OAAO,WAAW,CAAC,CAAA;IACjC,KAAK,EAAE,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAA;IAC1C,gBAAgB,EAAE,GAAG,EAAE,CAAA;IACvB,QAAQ,CAAC,EAAE,kBAAkB,CAAA;CAC9B,CACA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"schema-payload.d.ts","sourceRoot":"","sources":["../../../src/asyncapi/3.1/schema-payload.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,+BAA+B;;;EAa3C,CAAA;AAQD,uCAAuC;AACvC,eAAO,MAAM,+BAA+B,qCAAwC,CAAA;AAEpF,oEAAoE;AACpE,eAAO,MAAM,qBAAqB,qCAIjC,CAAA"}
1
+ {"version":3,"file":"schema-payload.d.ts","sourceRoot":"","sources":["../../../src/asyncapi/3.1/schema-payload.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,+BAA+B;;;EAa3C,CAAA;AAOD,uCAAuC;AACvC,eAAO,MAAM,+BAA+B,qCAAwC,CAAA;AAEpF,oEAAoE;AACpE,eAAO,MAAM,qBAAqB,qCAIjC,CAAA"}
@@ -9,9 +9,8 @@ export const asyncApiMultiFormatSchemaObject = object({
9
9
  typeComment: 'REQUIRED. Schema definition in the format given by schemaFormat.',
10
10
  }),
11
11
  }, { typeName: 'AsyncApiMultiFormatSchemaObject' });
12
- // AsyncAPI's default schema format is JSON Schema, the same dialect OpenAPI 3.1 uses, so we reuse the
13
- // OpenAPI Schema Object here instead of an opaque `unknown`. A schema may also be a boolean per JSON Schema.
14
- const asyncApiSchemaJsonShape = union([literal(true), literal(false), createSchema(true)], {
12
+ // Share the recursive JSON Schema fields while retaining AsyncAPI's property-name discriminator.
13
+ const asyncApiSchemaJsonShape = union([literal(true), literal(false), createSchema(true, string())], {
15
14
  typeName: 'AsyncApiSchemaJsonShape',
16
15
  });
17
16
  /** Schema Object | Reference Object */
@@ -1,6 +1,6 @@
1
1
  import { lazy, record, string } from '@scalar/validation';
2
- import { pathItem } from '../../openapi/3.1/path-item.js';
3
- import { recursiveRef } from '../../openapi/3.1/reference.js';
2
+ import { pathItem } from './path-item.js';
3
+ import { recursiveRef } from './reference.js';
4
4
  export const callback = record(string(), recursiveRef(lazy(() => pathItem)), {
5
5
  typeName: 'CallbackObject',
6
6
  });
@@ -1,15 +1,15 @@
1
1
  import { lazy, object, optional, record, string } from '@scalar/validation';
2
- import { callback } from '../../openapi/3.1/callback.js';
3
- import { example } from '../../openapi/3.1/example.js';
4
- import { link } from '../../openapi/3.1/link.js';
5
- import { header } from '../../openapi/3.1/media-type.js';
6
- import { parameter } from '../../openapi/3.1/parameter.js';
7
- import { pathItem } from '../../openapi/3.1/path-item.js';
8
- import { normalRef, recursiveRef } from '../../openapi/3.1/reference.js';
9
- import { requestBody } from '../../openapi/3.1/request-body.js';
10
- import { response } from '../../openapi/3.1/response.js';
11
- import { schema } from '../../openapi/3.1/schema.js';
12
- import { securityScheme } from '../../openapi/3.1/security-schemes.js';
2
+ import { callback } from './callback.js';
3
+ import { example } from './example.js';
4
+ import { link } from './link.js';
5
+ import { header } from './media-type.js';
6
+ import { parameter } from './parameter.js';
7
+ import { pathItem } from './path-item.js';
8
+ import { normalRef, recursiveRef } from './reference.js';
9
+ import { requestBody } from './request-body.js';
10
+ import { response } from './response.js';
11
+ import { schema } from './schema.js';
12
+ import { securityScheme } from './security-schemes.js';
13
13
  export const components = lazy(() => object({
14
14
  schemas: optional(record(string(), normalRef(schema), { typeName: 'ComponentsSchemas' })),
15
15
  responses: optional(record(string(), recursiveRef(lazy(() => response)), { typeName: 'ComponentsResponses' })),
@@ -3,14 +3,14 @@ import { XOriginalOasVersion, XScalarEnvironments, XScalarIcon, XScalarIsDirty,
3
3
  import { XPostResponse, XPreRequest, XScalarActiveEnvironment, XScalarCookies, XScalarOrder, } from '../../extensions/general/index.js';
4
4
  import { XScalarSelectedServer } from '../../extensions/server/index.js';
5
5
  import { XTagGroups } from '../../extensions/tag/index.js';
6
- import { components } from '../../openapi/3.1/components.js';
7
- import { externalDocs } from '../../openapi/3.1/external-docs.js';
8
- import { info } from '../../openapi/3.1/info.js';
9
- import { pathItem } from '../../openapi/3.1/path-item.js';
10
- import { recursiveRef } from '../../openapi/3.1/reference.js';
11
- import { securityRequirement } from '../../openapi/3.1/security-requirement.js';
12
- import { server } from '../../openapi/3.1/server.js';
13
- import { tag } from '../../openapi/3.1/tag.js';
6
+ import { components } from './components.js';
7
+ import { externalDocs } from './external-docs.js';
8
+ import { info } from './info.js';
9
+ import { pathItem } from './path-item.js';
10
+ import { recursiveRef } from './reference.js';
11
+ import { securityRequirement } from './security-requirement.js';
12
+ import { server } from './server.js';
13
+ import { tag } from './tag.js';
14
14
  const openapiExtensions = intersection([
15
15
  XOriginalOasVersion,
16
16
  XScalarNavigation,
@@ -1,7 +1,7 @@
1
1
  import { intersection, object, optional, string } from '@scalar/validation';
2
2
  import { XScalarLinks, XScalarSdkInstallation } from '../../extensions/document/index.js';
3
- import { contact } from '../../openapi/3.1/contact.js';
4
- import { license } from '../../openapi/3.1/license.js';
3
+ import { contact } from './contact.js';
4
+ import { license } from './license.js';
5
5
  export const info = intersection([
6
6
  object({
7
7
  title: string({ typeComment: 'REQUIRED. The title of the API.' }),
@@ -1,5 +1,5 @@
1
1
  import { any, object, optional, record, string } from '@scalar/validation';
2
- import { server } from '../../openapi/3.1/server.js';
2
+ import { server } from './server.js';
3
3
  export const link = object({
4
4
  operationRef: optional(string({
5
5
  typeComment: 'A URI reference to an OAS operation. This field is mutually exclusive of the operationId field, and MUST point to an Operation Object.',
@@ -1,7 +1,7 @@
1
1
  import { any, boolean, intersection, lazy, object, optional, record, string, union, } from '@scalar/validation';
2
- import { example } from '../../openapi/3.1/example.js';
3
- import { normalRef, recursiveRef } from '../../openapi/3.1/reference.js';
4
- import { schema } from '../../openapi/3.1/schema.js';
2
+ import { example } from './example.js';
3
+ import { normalRef, recursiveRef } from './reference.js';
4
+ import { schema } from './schema.js';
5
5
  const headerBase = object({
6
6
  description: optional(string({
7
7
  typeComment: 'A brief description of the header. This could contain examples of use. CommonMark syntax MAY be used for rich text representation.',
@@ -3,14 +3,14 @@ import { XInternal, XScalarIgnore } from '../../extensions/document/index.js';
3
3
  import { XPostResponse, XPreRequest } from '../../extensions/general/index.js';
4
4
  import { XBadges, XCodeSamples, XDraftExamples, XScalarDisableParameters, XScalarStability, } from '../../extensions/operation/index.js';
5
5
  import { XScalarSelectedServer } from '../../extensions/server/index.js';
6
- import { callback } from '../../openapi/3.1/callback.js';
7
- import { externalDocs } from '../../openapi/3.1/external-docs.js';
8
- import { parameter } from '../../openapi/3.1/parameter.js';
9
- import { recursiveRef } from '../../openapi/3.1/reference.js';
10
- import { requestBody } from '../../openapi/3.1/request-body.js';
11
- import { responsesObject } from '../../openapi/3.1/response.js';
12
- import { securityRequirement } from '../../openapi/3.1/security-requirement.js';
13
- import { server } from '../../openapi/3.1/server.js';
6
+ import { callback } from './callback.js';
7
+ import { externalDocs } from './external-docs.js';
8
+ import { parameter } from './parameter.js';
9
+ import { recursiveRef } from './reference.js';
10
+ import { requestBody } from './request-body.js';
11
+ import { responsesObject } from './response.js';
12
+ import { securityRequirement } from './security-requirement.js';
13
+ import { server } from './server.js';
14
14
  export const operation = intersection([
15
15
  object({
16
16
  tags: optional(array(string(), {
@@ -1,10 +1,10 @@
1
1
  import { any, boolean, intersection, lazy, literal, object, optional, record, string, union } from '@scalar/validation';
2
2
  import { XInternal, XScalarIgnore } from '../../extensions/document/index.js';
3
3
  import { XGlobal } from '../../extensions/parameter/index.js';
4
- import { example } from '../../openapi/3.1/example.js';
5
- import { mediaType } from '../../openapi/3.1/media-type.js';
6
- import { normalRef, recursiveRef } from '../../openapi/3.1/reference.js';
7
- import { schema } from '../../openapi/3.1/schema.js';
4
+ import { example } from './example.js';
5
+ import { mediaType } from './media-type.js';
6
+ import { normalRef, recursiveRef } from './reference.js';
7
+ import { schema } from './schema.js';
8
8
  const parameterWithSchema = intersection([
9
9
  object({
10
10
  name: string({
@@ -1,8 +1,8 @@
1
1
  import { array, lazy, object, optional, string } from '@scalar/validation';
2
- import { operation } from '../../openapi/3.1/operation.js';
3
- import { parameter } from '../../openapi/3.1/parameter.js';
4
- import { recursiveRef } from '../../openapi/3.1/reference.js';
5
- import { server } from '../../openapi/3.1/server.js';
2
+ import { operation } from './operation.js';
3
+ import { parameter } from './parameter.js';
4
+ import { recursiveRef } from './reference.js';
5
+ import { server } from './server.js';
6
6
  export const pathItem = object({
7
7
  $ref: optional(string({
8
8
  typeComment: 'Allows for a referenced definition of this path item. The value MUST be in the form of a URI, and the referenced structure MUST be in the form of a Path Item Object.',
@@ -1,6 +1,6 @@
1
1
  import { boolean, intersection, lazy, object, optional, record, string } from '@scalar/validation';
2
2
  import { XScalarSelectedContentType } from '../../extensions/operation/index.js';
3
- import { mediaType } from '../../openapi/3.1/media-type.js';
3
+ import { mediaType } from './media-type.js';
4
4
  export const requestBody = intersection([
5
5
  object({
6
6
  description: optional(string({
@@ -1,7 +1,7 @@
1
1
  import { lazy, object, optional, record, string } from '@scalar/validation';
2
- import { link } from '../../openapi/3.1/link.js';
3
- import { header, mediaType } from '../../openapi/3.1/media-type.js';
4
- import { recursiveRef } from '../../openapi/3.1/reference.js';
2
+ import { link } from './link.js';
3
+ import { header, mediaType } from './media-type.js';
4
+ import { recursiveRef } from './reference.js';
5
5
  export const response = object({
6
6
  description: string({
7
7
  typeComment: 'REQUIRED. A description of the response. CommonMark syntax MAY be used for rich text representation.',
@@ -3,6 +3,6 @@ import { type Schema } from '@scalar/validation';
3
3
  * Build the shared Schema Object shape, optionally accepting boolean child schemas.
4
4
  * AsyncAPI uses JSON Schema booleans recursively; the OpenAPI ingestion pipeline normalizes them first.
5
5
  */
6
- export declare const createSchema: (booleanSchemas?: boolean) => Schema;
6
+ export declare const createSchema: (booleanSchemas?: boolean, discriminator?: Schema) => Schema;
7
7
  export declare const schema: Schema;
8
8
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/openapi/3.1/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAaZ,MAAM,oBAAoB,CAAA;AAS3B;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,wBAAsB,KAAG,MA6KrD,CAAA;AAED,eAAO,MAAM,MAAM,QAAiB,CAAA"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/openapi/3.1/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAaZ,MAAM,oBAAoB,CAAA;AAS3B;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,wBAAsB,EAAE,gBAAe,MAA4B,KAAG,MA6KlG,CAAA;AAED,eAAO,MAAM,MAAM,QAAiB,CAAA"}
@@ -1,15 +1,15 @@
1
1
  import { any, array, boolean, intersection, lazy, literal, number, object, optional, record, string, union, } from '@scalar/validation';
2
2
  import { XInternal, XScalarIgnore, XTags } from '../../extensions/document/index.js';
3
3
  import { XAdditionalPropertiesName, XEnumDescriptions, XEnumVarNames, XExamples, XVariable } from '../../extensions/schema/index.js';
4
- import { discriminatorObject } from '../../openapi/3.1/discriminator.js';
5
- import { externalDocs } from '../../openapi/3.1/external-docs.js';
6
- import { normalRef } from '../../openapi/3.1/reference.js';
7
- import { xml } from '../../openapi/3.1/xml.js';
4
+ import { discriminatorObject } from './discriminator.js';
5
+ import { externalDocs } from './external-docs.js';
6
+ import { normalRef } from './reference.js';
7
+ import { xml } from './xml.js';
8
8
  /**
9
9
  * Build the shared Schema Object shape, optionally accepting boolean child schemas.
10
10
  * AsyncAPI uses JSON Schema booleans recursively; the OpenAPI ingestion pipeline normalizes them first.
11
11
  */
12
- export const createSchema = (booleanSchemas = false) => {
12
+ export const createSchema = (booleanSchemas = false, discriminator = discriminatorObject) => {
13
13
  const schemaExtensionObjects = [
14
14
  XScalarIgnore,
15
15
  XInternal,
@@ -31,7 +31,7 @@ export const createSchema = (booleanSchemas = false) => {
31
31
  contentEncoding: optional(string({ typeComment: 'Content encoding.' })),
32
32
  contentSchema: optional(normalRef(lazy(() => nestedSchema))),
33
33
  deprecated: optional(boolean({ typeComment: 'Whether the schema is deprecated.' })),
34
- discriminator: optional(discriminatorObject),
34
+ discriminator: optional(discriminator),
35
35
  readOnly: optional(boolean({ typeComment: 'Whether the schema is read-only.' })),
36
36
  writeOnly: optional(boolean({ typeComment: 'Whether the schema is write-only.' })),
37
37
  xml: optional(xml),
@@ -1,5 +1,5 @@
1
1
  import { object, optional, record, string } from '@scalar/validation';
2
- import { serverVariable } from '../../openapi/3.1/server-variable.js';
2
+ import { serverVariable } from './server-variable.js';
3
3
  export const server = object({
4
4
  url: string({
5
5
  typeComment: 'REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the document containing the Server Object is being served. Variable substitutions will be made when a variable is named in {braces}.',
@@ -2,7 +2,7 @@ import { intersection, object, optional, string } from '@scalar/validation';
2
2
  import { XInternal, XScalarIgnore } from '../../extensions/document/index.js';
3
3
  import { XScalarOrder } from '../../extensions/general/index.js';
4
4
  import { XDisplayName } from '../../extensions/tag/index.js';
5
- import { externalDocs } from '../../openapi/3.1/external-docs.js';
5
+ import { externalDocs } from './external-docs.js';
6
6
  export const tag = intersection([
7
7
  object({
8
8
  name: string({ typeComment: 'REQUIRED. The name of the tag.' }),
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "schemas",
15
15
  "scalar"
16
16
  ],
17
- "version": "0.13.2",
17
+ "version": "0.15.0",
18
18
  "engines": {
19
19
  "node": ">=22"
20
20
  },
@@ -41,12 +41,12 @@
41
41
  "CHANGELOG.md"
42
42
  ],
43
43
  "dependencies": {
44
- "@scalar/helpers": "0.16.3",
44
+ "@scalar/helpers": "0.16.4",
45
45
  "@scalar/validation": "0.6.7"
46
46
  },
47
47
  "devDependencies": {
48
- "@scalar/types": "0.23.2",
49
- "vitest": "4.1.10"
48
+ "@scalar/types": "0.25.0",
49
+ "vitest": "4.1.12"
50
50
  },
51
51
  "scripts": {
52
52
  "build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",