MCPcopy Index your code
hub / github.com/Effect-TS/effect / mergeJsonSchemaAnnotations

Function mergeJsonSchemaAnnotations

packages/effect/src/JSONSchema.ts:520–531  ·  view source on GitHub ↗
(
  jsonSchema: JsonSchema7,
  jsonSchemaAnnotations: JsonSchemaAnnotations | undefined
)

Source from the content-addressed store, hash-verified

518}
519
520function mergeJsonSchemaAnnotations(
521 jsonSchema: JsonSchema7,
522 jsonSchemaAnnotations: JsonSchemaAnnotations | undefined
523): JsonSchema7 {
524 if (jsonSchemaAnnotations) {
525 if ("$ref" in jsonSchema) {
526 return { allOf: [jsonSchema], ...jsonSchemaAnnotations } as any
527 }
528 return { ...jsonSchema, ...jsonSchemaAnnotations }
529 }
530 return jsonSchema
531}
532
533const pruneUndefined = (ast: AST.AST): AST.AST | undefined => {
534 if (Option.isNone(AST.getJSONSchemaAnnotation(ast))) {

Callers 1

goFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected