MCPcopy
hub / github.com/pydantic/pydantic / get_json_schema

Method get_json_schema

pydantic/_internal/_generate_schema.py:439–443  ·  view source on GitHub ↗
(schema: CoreSchema, handler: GetJsonSchemaHandler)

Source from the content-addressed store, hash-verified

437 if cases:
438
439 def get_json_schema(schema: CoreSchema, handler: GetJsonSchemaHandler) -> JsonSchemaValue:
440 json_schema = handler(schema)
441 original_schema = handler.resolve_ref_schema(json_schema)
442 original_schema.update(js_updates)
443 return json_schema
444
445 # we don't want to add the missing to the schema if it's the default one
446 default_missing = getattr(enum_type._missing_, '__func__', None) is Enum._missing_.__func__ # pyright: ignore[reportFunctionMemberAccess]

Callers

nothing calls this directly

Calls 3

handlerFunction · 0.70
resolve_ref_schemaMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected