MCPcopy Index your code
hub / github.com/github/copilot-sdk / schemaForConstValue

Function schemaForConstValue

scripts/codegen/go.ts:817–833  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

815}
816
817function schemaForConstValue(value: unknown): JSONSchema7 {
818 if (value === null) return { type: "null" };
819 if (Array.isArray(value)) return { type: "array", items: {} };
820
821 switch (typeof value) {
822 case "boolean":
823 return { type: "boolean" };
824 case "number":
825 return { type: Number.isInteger(value) ? "integer" : "number" };
826 case "string":
827 return { type: "string" };
828 case "object":
829 return { type: "object", additionalProperties: true };
830 default:
831 return {};
832 }
833}
834
835/**
836 * Resolve a JSON Schema property to a Go type string.

Callers 2

resolveGoPropertyTypeFunction · 0.85
goSchemaJSONKindFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…