Skip to content

Commit

Permalink
build: Update OpenAPI Generator
Browse files Browse the repository at this point in the history
  • Loading branch information
MoritzWeber0 committed Sep 6, 2024
1 parent b9f90b1 commit 86c93da
Show file tree
Hide file tree
Showing 17 changed files with 39 additions and 33 deletions.
12 changes: 9 additions & 3 deletions backend/capellacollab/core/pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@


def datetime_serializer(
dt: datetime.datetime,
) -> datetime.datetime:
return dt.replace(tzinfo=datetime.UTC)


def datetime_serializer_optional(
dt: datetime.datetime | None,
) -> datetime.datetime | None:
if dt:
return dt.replace(tzinfo=datetime.UTC)
return None
if dt is None:
return None
return datetime_serializer(dt)


class BaseModel(pydantic.BaseModel):
Expand Down
4 changes: 2 additions & 2 deletions backend/capellacollab/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ class User(BaseUser):
last_login: datetime.datetime | None = None

_validate_created = pydantic.field_serializer("created")(
core_pydantic.datetime_serializer
core_pydantic.datetime_serializer_optional
)
_validate_last_login = pydantic.field_serializer("last_login")(
core_pydantic.datetime_serializer
core_pydantic.datetime_serializer_optional
)


Expand Down
2 changes: 1 addition & 1 deletion frontend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ openapi:
-v $$(pwd)/openapi_templates:/tmp/openapi_templates \
-v $$OPENAPI_DIR:/tmp/output \
-u $$(id -u $${USER}):$$(id -g $${USER}) \
openapitools/openapi-generator-cli:v7.7.0 generate \
openapitools/openapi-generator-cli:v7.8.0 generate \
-i /tmp/openapi.json \
-t /tmp/openapi_templates \
--global-property models,apis,supportingFiles="index.ts:api.ts:models.ts:variables.ts:configuration.ts:api.module.ts:param.ts:encoder.ts" \
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/openapi/.openapi-generator/FILES

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/src/app/openapi/.openapi-generator/VERSION

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions frontend/src/app/openapi/model/models.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 86c93da

Please sign in to comment.