MCPcopy Create free account
hub / github.com/arktypeio/arktype / writeOwn

Function writeOwn

ark/sets/toJsonSchema.ts:776–785  ·  view source on GitHub ↗
(
	write: StandardJSONSchemaV1.Converter["input"],
	ctx: JsonSchemaContext
)

Source from the content-addressed store, hash-verified

774}
775
776const writeOwn = (
777 write: StandardJSONSchemaV1.Converter["input"],
778 ctx: JsonSchemaContext
779): JsonSchema => {
780 // an OpenAPI 3.1 Schema Object is draft-2020-12, which Standard JSON Schema names
781 const { $schema, ...schema } = write({
782 target: ctx.target === "openapi-3.1" ? "draft-2020-12" : ctx.target
783 })
784 return schema
785}
786
787const foreignFallback = (
788 ctx: JsonSchemaContext,

Callers 1

foreignToJsonSchemaFunction · 0.85

Calls 1

writeFunction · 0.50

Tested by

no test coverage detected