(
ctx: JsonSchemaContext,
reason?: string,
sides: Pick<ToJsonSchema.MorphContext, "base" | "out"> = {
base: {},
out: null
}
)
| 785 | } |
| 786 | |
| 787 | const foreignFallback = ( |
| 788 | ctx: JsonSchemaContext, |
| 789 | reason?: string, |
| 790 | sides: Pick<ToJsonSchema.MorphContext, "base" | "out"> = { |
| 791 | base: {}, |
| 792 | out: null |
| 793 | } |
| 794 | ): JsonSchema => { |
| 795 | try { |
| 796 | return ctx.fallback.morph({ code: "morph", ...sides }) |
| 797 | } catch (e) { |
| 798 | if (!(e instanceof ToJsonSchema.Error) || !e.hasCode("morph")) throw e |
| 799 | return ToJsonSchema.throw( |
| 800 | "morph", |
| 801 | e.context, |
| 802 | ctx.path, |
| 803 | `Can't convert the Type${ctx.path && ` at ${ctx.path}`} to ${ctx.target} JSON Schema${reason ? `, since ${reason}` : ""}. ${writeForeignArkMessage("It")}` |
| 804 | ) |
| 805 | } |
| 806 | } |
| 807 | |
| 808 | const reduceObjectJsonSchema = ( |
| 809 | node: Structure.Node, |
no test coverage detected