diff --git a/README.md b/README.md index 96075df68..4eac0802a 100644 --- a/README.md +++ b/README.md @@ -182,13 +182,25 @@ components: `model.py`: ```python +# generated by datamodel-codegen: +# filename: api.yaml +# timestamp: 2019-07-23T14:23:18+00:00 + +from typing import List, Optional + +from pydantic import BaseModel + + + class Pet(BaseModel): id: int name: str - tag: str = None + tag: Optional[str] = None + +class Pets(BaseModel): + __root__: List[Pet] -Pets = List[Pet] class Error(BaseModel): code: int @@ -196,11 +208,12 @@ class Error(BaseModel): class api(BaseModel): - apiKey: str = None - apiVersionNumber: str = None + apiKey: Optional[str] = None + apiVersionNumber: Optional[str] = None -apis = List[api] +class apis(BaseModel): + __root__: List[api] ``` ## Development