Skip to content

Commit

Permalink
fix: use double quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
simontaurus committed Mar 27, 2023
1 parent e58527d commit e739463
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/osw/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ def fetch_schema(self, fetchSchemaParam: FetchSchemaParam = None) -> None:
--use-schema-description \
--use-field-description \
--encoding utf-8 \
--use-double-quotes \
"
)
# see https://koxudaxi.github.io/datamodel-code-generator/
Expand Down Expand Up @@ -372,15 +373,17 @@ def fetch_schema(self, fetchSchemaParam: FetchSchemaParam = None) -> None:
"if TYPE_CHECKING:\n"
" from dataclasses import dataclass as _basemodel_decorator\n"
"else:\n"
" _basemodel_decorator = lambda x: x # noqa: E731\n"
" _basemodel_decorator = lambda x: x # noqa: E731\n"
"\n"
)
header += (
"\nT = TypeVar('T', bound=BaseModel)\n"
'\nT = TypeVar("T", bound=BaseModel)\n'
"\nclass OswBaseModel(BaseModel):\n"
" def full_dict(self, **kwargs): #extent BaseClass export function\n"
" d = super().dict(**kwargs)\n"
" for key in " + str(self._protected_keywords) + ":\n"
" for key in "
+ str(self._protected_keywords).replace("'", '"')
+ ":\n"
" if hasattr(self, key): d[key] = getattr(self, key) #include selected private properites. note: private properties are not considered as discriminator \n"
" return d\n\n"
" def cast(self, cls: Type[T]) -> T:\n"
Expand Down

0 comments on commit e739463

Please sign in to comment.