Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ark/docs/components/dts/schema.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ark/docs/components/dts/util.ts

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions ark/schema/roots/root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ export abstract class BaseRoot<
}

toJsonSchemaRecurse(ctx: ToJsonSchema.Context): JsonSchema {
if (ctx.useRefs && !this.alwaysExpandJsonSchema)
return { $ref: `#/$defs/${this.id}` }
if (ctx.useRefs && !this.alwaysExpandJsonSchema) {
const defId = this.meta.defId ?? this.id
return { $ref: `#/$defs/${defId}` }
}

return this.toResolvedJsonSchema(ctx)
}
Expand Down
1 change: 1 addition & 0 deletions ark/schema/shared/declare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface NodeMeta
extends JsonSchema.UniversalMeta,
UnknownErrorConfigs {
alias?: string
defId?: string
onFail?: ArkErrors.Handler
}

Expand Down
Loading