MCPcopy
hub / github.com/pydantic/pydantic / date_schema

Method date_schema

pydantic/json_schema.py:792–801  ·  view source on GitHub ↗

Generates a JSON schema that matches a date value. Args: schema: The core schema. Returns: The generated JSON schema.

(self, schema: core_schema.DateSchema)

Source from the content-addressed store, hash-verified

790 return json_schema
791
792 def date_schema(self, schema: core_schema.DateSchema) -> JsonSchemaValue:
793 """Generates a JSON schema that matches a date value.
794
795 Args:
796 schema: The core schema.
797
798 Returns:
799 The generated JSON schema.
800 """
801 return {'type': 'string', 'format': 'date'}
802
803 def time_schema(self, schema: core_schema.TimeSchema) -> JsonSchemaValue:
804 """Generates a JSON schema that matches a time value.

Callers 15

match_typeMethod · 0.80
test_dictFunction · 0.80
test_modelFunction · 0.80
test_dataclassFunction · 0.80
test_typed_dictFunction · 0.80
test_dateFunction · 0.80
test_date_keyFunction · 0.80
test_date_datetime_unionFunction · 0.80
test_config_dateFunction · 0.80

Calls

no outgoing calls

Tested by 15

test_dictFunction · 0.64
test_modelFunction · 0.64
test_dataclassFunction · 0.64
test_typed_dictFunction · 0.64
test_dateFunction · 0.64
test_date_keyFunction · 0.64
test_date_datetime_unionFunction · 0.64
test_config_dateFunction · 0.64