Skip to content

Commit

Permalink
fix: dependencies updated. Model generator documentation updated (#285)
Browse files Browse the repository at this point in the history
Co-authored-by: Marcos Schroh <marcos.schroh@kpn.com>
  • Loading branch information
marcosschroh and marcosschroh committed Apr 6, 2023
1 parent cf36c3a commit eedc575
Show file tree
Hide file tree
Showing 2 changed files with 1,122 additions and 1,179 deletions.
8 changes: 3 additions & 5 deletions docs/model_generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,13 @@ and then render the result:
from pydantic import BaseModel
from pydantic import Field
from pydantic import condecimal
import decimal
import typing


class User(BaseModel):
name: str
age: int
money: decimal.Decimal = condecimal(max_digits=10, decimal_places=3)
money: condecimal(max_digits=10, decimal_places=3)
friend: typing.Optional[typing.Type["User"]] = None
relatives: typing.List[typing.Type["User"]] = Field(default_factory=list)
teammates: typing.Dict[str, typing.Type["User"]] = Field(default_factory=dict)
Expand All @@ -182,14 +181,13 @@ and then render the result:
from dataclasses_avroschema.avrodantic import AvroBaseModel
from pydantic import Field
from pydantic import condecimal
import decimal
import typing


class User(AvroBaseModel):
name: str
age: int
money: decimal.Decimal = condecimal(max_digits=10, decimal_places=3)
money: condecimal(max_digits=10, decimal_places=3)
friend: typing.Optional[typing.Type["User"]] = None
relatives: typing.List[typing.Type["User"]] = Field(default_factory=list)
teammates: typing.Dict[str, typing.Type["User"]] = Field(default_factory=dict)
Expand Down Expand Up @@ -359,5 +357,5 @@ print(User.fake())
| time-micros| types.TimeMicro|
| timestamp-millis| datetime.datetime|
| timestamp-micros| types.DateTimeMicro|
| decimal | decimal.Decimal|
| decimal | types.condecimal|
| uuid | uuid.UUID |
Loading

0 comments on commit eedc575

Please sign in to comment.