From ed39a02586c4c7bb8e6d40f6772271186539e6d6 Mon Sep 17 00:00:00 2001 From: shgokita Date: Thu, 26 Dec 2024 15:37:16 +0900 Subject: [PATCH] chore: fix datetime formats --- backend/oas/provider/openapi.yaml | 12 +++++----- backend/oas/provider/schemas/jobs.yaml | 12 +++++----- backend/oas/user/openapi.yaml | 12 +++++----- backend/oas/user/schemas/jobs.yaml | 12 +++++----- .../oqtopus_cloud/provider/schemas/jobs.py | 12 +++++----- backend/oqtopus_cloud/user/schemas/jobs.py | 24 +++++++++---------- docs/oas/provider/openapi.yaml | 12 +++++----- docs/oas/user/openapi.yaml | 12 +++++----- 8 files changed, 54 insertions(+), 54 deletions(-) diff --git a/backend/oas/provider/openapi.yaml b/backend/oas/provider/openapi.yaml index 3419e04..4490648 100644 --- a/backend/oas/provider/openapi.yaml +++ b/backend/oas/provider/openapi.yaml @@ -517,7 +517,7 @@ components: updated_at: type: string format: date-time - example: '2022-10-19T11:45:34' + example: '2022-10-19T11:45:34+09:00' required: [] example: job_id: 7af020f6-2e38-4d70-8cf0-4349650ea08c @@ -557,8 +557,8 @@ components: job_type: sampling shots: 1000 status: submitted - created_at: '2022-10-19T11:45:34' - updated_at: '2022-10-19T11:45:34' + created_at: '2022-10-19T11:45:34+09:00' + updated_at: '2022-10-19T11:45:34+09:00' jobs.JobDef: type: object properties: @@ -618,7 +618,7 @@ components: updated_at: type: string format: date-time - example: '2022-10-19T11:45:34' + example: '2022-10-19T11:45:34+09:00' required: - job_id - device_id @@ -664,8 +664,8 @@ components: job_type: sampling shots: 1000 status: submitted - created_at: '2022-10-19T11:45:34' - updated_at: '2022-10-19T11:45:34' + created_at: '2022-10-19T11:45:34+09:00' + updated_at: '2022-10-19T11:45:34+09:00' jobs.JobStatusUpdate: type: object properties: diff --git a/backend/oas/provider/schemas/jobs.yaml b/backend/oas/provider/schemas/jobs.yaml index 0782ad3..a0ce7a9 100644 --- a/backend/oas/provider/schemas/jobs.yaml +++ b/backend/oas/provider/schemas/jobs.yaml @@ -159,7 +159,7 @@ jobs.JobDef: updated_at: type: string format: date-time - example: 2022-10-19T11:45:34 + example: 2022-10-19T11:45:34+09:00 required: - job_id - device_id @@ -211,8 +211,8 @@ jobs.JobDef: job_type: sampling shots: 1000 status: submitted - created_at: 2022-10-19T11:45:34 - updated_at: 2022-10-19T11:45:34 + created_at: 2022-10-19T11:45:34+09:00 + updated_at: 2022-10-19T11:45:34+09:00 jobs.GetJobsResponse: type: object @@ -273,7 +273,7 @@ jobs.GetJobsResponse: updated_at: type: string format: date-time - example: 2022-10-19T11:45:34 + example: 2022-10-19T11:45:34+09:00 required: [] example: job_id: 7af020f6-2e38-4d70-8cf0-4349650ea08c @@ -319,8 +319,8 @@ jobs.GetJobsResponse: job_type: sampling shots: 1000 status: submitted - created_at: 2022-10-19T11:45:34 - updated_at: 2022-10-19T11:45:34 + created_at: 2022-10-19T11:45:34+09:00 + updated_at: 2022-10-19T11:45:34+09:00 jobs.JobStatusUpdate: type: object diff --git a/backend/oas/user/openapi.yaml b/backend/oas/user/openapi.yaml index 8fbb79d..e0b8735 100644 --- a/backend/oas/user/openapi.yaml +++ b/backend/oas/user/openapi.yaml @@ -825,11 +825,11 @@ components: created_at: type: string format: date-time - example: '2022-10-19T11:45:34' + example: '2022-10-19T11:45:34+09:00' updated_at: type: string format: date-time - example: '2022-10-19T11:45:34' + example: '2022-10-19T11:45:34+09:00' required: - name - device_id @@ -884,11 +884,11 @@ components: created_at: type: string format: date-time - example: '2022-10-19T11:45:34Z' + example: '2022-10-19T11:45:34+09:00' updated_at: type: string format: date-time - example: '2022-10-19T11:45:34Z' + example: '2022-10-19T11:45:34+09:00' required: - job_id - name @@ -915,8 +915,8 @@ components: mitigation_info: '{ "ro_error_mitigation": "pseudo_inverse" }' shots: 1000 status: submitted - created_at: '2022-10-19T11:45:34' - updated_at: '2022-10-19T11:45:34' + created_at: '2022-10-19T11:45:34+09:00' + updated_at: '2022-10-19T11:45:34+09:00' success.SuccessResponse: type: object properties: diff --git a/backend/oas/user/schemas/jobs.yaml b/backend/oas/user/schemas/jobs.yaml index 88e8610..e49b76c 100644 --- a/backend/oas/user/schemas/jobs.yaml +++ b/backend/oas/user/schemas/jobs.yaml @@ -187,11 +187,11 @@ jobs.JobDef: created_at: type: string format: date-time - example: 2022-10-19T11:45:34Z + example: 2022-10-19T11:45:34+09:00 updated_at: type: string format: date-time - example: 2022-10-19T11:45:34Z + example: 2022-10-19T11:45:34+09:00 required: - job_id - name @@ -221,8 +221,8 @@ jobs.JobDef: { "ro_error_mitigation": "pseudo_inverse" } shots: 1000 status: submitted - created_at: 2022-10-19T11:45:34 - updated_at: 2022-10-19T11:45:34 + created_at: 2022-10-19T11:45:34+09:00 + updated_at: 2022-10-19T11:45:34+09:00 jobs.SubmitJobRequest: @@ -270,11 +270,11 @@ jobs.SubmitJobRequest: created_at: type: string format: date-time - example: 2022-10-19T11:45:34 + example: 2022-10-19T11:45:34+09:00 updated_at: type: string format: date-time - example: 2022-10-19T11:45:34 + example: 2022-10-19T11:45:34+09:00 required: - name - device_id diff --git a/backend/oqtopus_cloud/provider/schemas/jobs.py b/backend/oqtopus_cloud/provider/schemas/jobs.py index e968afe..521938b 100644 --- a/backend/oqtopus_cloud/provider/schemas/jobs.py +++ b/backend/oqtopus_cloud/provider/schemas/jobs.py @@ -109,9 +109,9 @@ class GetJobsResponse(BaseModel): created_at: Annotated[ datetime | None, Field(examples=["2022-10-19T11:45:34+09:00"]) ] = None - updated_at: Annotated[datetime | None, Field(examples=["2022-10-19T11:45:34"])] = ( - None - ) + updated_at: Annotated[ + datetime | None, Field(examples=["2022-10-19T11:45:34+09:00"]) + ] = None class JobDef(BaseModel): @@ -144,9 +144,9 @@ class JobDef(BaseModel): ] = None status: JobStatus created_at: Annotated[datetime, Field(examples=["2022-10-19T11:45:34+09:00"])] - updated_at: Annotated[datetime | None, Field(examples=["2022-10-19T11:45:34"])] = ( - None - ) + updated_at: Annotated[ + datetime | None, Field(examples=["2022-10-19T11:45:34+09:00"]) + ] = None class JobStatusUpdate(BaseModel): diff --git a/backend/oqtopus_cloud/user/schemas/jobs.py b/backend/oqtopus_cloud/user/schemas/jobs.py index 05ca5b7..a93c417 100644 --- a/backend/oqtopus_cloud/user/schemas/jobs.py +++ b/backend/oqtopus_cloud/user/schemas/jobs.py @@ -145,12 +145,12 @@ class SubmitJobRequest(BaseModel): """ shots: Annotated[int, Field(examples=[1000])] status: Annotated[JobStatus | None, Field(examples=["submitted"])] = None - created_at: Annotated[datetime | None, Field(examples=["2022-10-19T11:45:34"])] = ( - None - ) - updated_at: Annotated[datetime | None, Field(examples=["2022-10-19T11:45:34"])] = ( - None - ) + created_at: Annotated[ + datetime | None, Field(examples=["2022-10-19T11:45:34+09:00"]) + ] = None + updated_at: Annotated[ + datetime | None, Field(examples=["2022-10-19T11:45:34+09:00"]) + ] = None class SubmitJobResponse(BaseModel): @@ -191,12 +191,12 @@ class JobDef(BaseModel): mitigation_info: Annotated[ str | None, Field(examples=['{\n "ro_error_mitigation": "pseudo_inverse"\n}']) ] = None - created_at: Annotated[datetime | None, Field(examples=["2022-10-19T11:45:34Z"])] = ( - None - ) - updated_at: Annotated[datetime | None, Field(examples=["2022-10-19T11:45:34Z"])] = ( - None - ) + created_at: Annotated[ + datetime | None, Field(examples=["2022-10-19T11:45:34+09:00"]) + ] = None + updated_at: Annotated[ + datetime | None, Field(examples=["2022-10-19T11:45:34+09:00"]) + ] = None class GetJobStatusResponse(BaseModel): diff --git a/docs/oas/provider/openapi.yaml b/docs/oas/provider/openapi.yaml index 3419e04..4490648 100644 --- a/docs/oas/provider/openapi.yaml +++ b/docs/oas/provider/openapi.yaml @@ -517,7 +517,7 @@ components: updated_at: type: string format: date-time - example: '2022-10-19T11:45:34' + example: '2022-10-19T11:45:34+09:00' required: [] example: job_id: 7af020f6-2e38-4d70-8cf0-4349650ea08c @@ -557,8 +557,8 @@ components: job_type: sampling shots: 1000 status: submitted - created_at: '2022-10-19T11:45:34' - updated_at: '2022-10-19T11:45:34' + created_at: '2022-10-19T11:45:34+09:00' + updated_at: '2022-10-19T11:45:34+09:00' jobs.JobDef: type: object properties: @@ -618,7 +618,7 @@ components: updated_at: type: string format: date-time - example: '2022-10-19T11:45:34' + example: '2022-10-19T11:45:34+09:00' required: - job_id - device_id @@ -664,8 +664,8 @@ components: job_type: sampling shots: 1000 status: submitted - created_at: '2022-10-19T11:45:34' - updated_at: '2022-10-19T11:45:34' + created_at: '2022-10-19T11:45:34+09:00' + updated_at: '2022-10-19T11:45:34+09:00' jobs.JobStatusUpdate: type: object properties: diff --git a/docs/oas/user/openapi.yaml b/docs/oas/user/openapi.yaml index 8fbb79d..e0b8735 100644 --- a/docs/oas/user/openapi.yaml +++ b/docs/oas/user/openapi.yaml @@ -825,11 +825,11 @@ components: created_at: type: string format: date-time - example: '2022-10-19T11:45:34' + example: '2022-10-19T11:45:34+09:00' updated_at: type: string format: date-time - example: '2022-10-19T11:45:34' + example: '2022-10-19T11:45:34+09:00' required: - name - device_id @@ -884,11 +884,11 @@ components: created_at: type: string format: date-time - example: '2022-10-19T11:45:34Z' + example: '2022-10-19T11:45:34+09:00' updated_at: type: string format: date-time - example: '2022-10-19T11:45:34Z' + example: '2022-10-19T11:45:34+09:00' required: - job_id - name @@ -915,8 +915,8 @@ components: mitigation_info: '{ "ro_error_mitigation": "pseudo_inverse" }' shots: 1000 status: submitted - created_at: '2022-10-19T11:45:34' - updated_at: '2022-10-19T11:45:34' + created_at: '2022-10-19T11:45:34+09:00' + updated_at: '2022-10-19T11:45:34+09:00' success.SuccessResponse: type: object properties: