mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
b7a8ef25c6
* fixing coverage by simplifying Annotated import logic, fix #2367 * avoid checking against annotated if it's None * make typing-extensions required WIP * more making typing-extensions required * fix docs and get_origin for python 3.6 * fix mypy test * fix docs * update docs, cleanup and add change * clean docs/examples/schema_annotated.py * move AnnotatedTypeNames
10 lines
249 B
Python
10 lines
249 B
Python
from uuid import uuid4
|
|
|
|
from pydantic import BaseModel, Field
|
|
from typing_extensions import Annotated
|
|
|
|
|
|
class Foo(BaseModel):
|
|
id: Annotated[str, Field(default_factory=lambda: uuid4().hex)]
|
|
name: Annotated[str, Field(max_length=256)] = 'Bar'
|