Skip to content

Commit

Permalink
Add support for reserved keywords Fix #17 #19
Browse files Browse the repository at this point in the history
  • Loading branch information
ruscoder committed Sep 6, 2024
1 parent 97d115d commit 2e94e49
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion fhir_py_types/header.py.tpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
from typing import List as List_, Optional as Optional_, Literal as Literal_, Annotated as Annotated_
from pydantic import BaseModel, Field, Extra

from pydantic import BaseModel as BaseModel_, Field, Extra


class BaseModel(BaseModel_):
class Config:
extra = Extra.forbid
validate_assignment = True
populate_by_name = True

def dict(self, *args, **kwargs):
by_alias = kwargs.pop('by_alias', True)
return super().dict(*args, **kwargs, by_alias=by_alias)

0 comments on commit 2e94e49

Please sign in to comment.