MCPcopy Create free account
hub / github.com/arctic-cli/interface / override

Function override

packages/arctic/script/schema.ts:18–37  ·  view source on GitHub ↗

* We'll use the `default` values of the field as the only value in `examples`. * This will ensure no docs are needed to be read, as the configuration is * self-documenting. * * See https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#rfc.section.9.5

(ctx)

Source from the content-addressed store, hash-verified

16 * See https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#rfc.section.9.5
17 */
18 override(ctx) {
19 const schema = ctx.jsonSchema
20
21 // Preserve strictness: set additionalProperties: false for objects
22 if (schema && typeof schema === "object" && schema.type === "object" && schema.additionalProperties === undefined) {
23 schema.additionalProperties = false
24 }
25
26 // Add examples and default descriptions for string fields with defaults
27 if (schema && typeof schema === "object" && "type" in schema && schema.type === "string" && schema?.default) {
28 if (!schema.examples) {
29 schema.examples = [schema.default]
30 }
31
32 schema.description = [schema.description || "", `default: \`${schema.default}\``]
33 .filter(Boolean)
34 .join("\n\n")
35 .trim()
36 }
37 },
38}) as Record<string, unknown> & {
39 allowComments?: boolean
40 allowTrailingCommas?: boolean

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected