diff --git a/backend/oas/user/openapi.yaml b/backend/oas/user/openapi.yaml index 1712421..a8eef40 100644 --- a/backend/oas/user/openapi.yaml +++ b/backend/oas/user/openapi.yaml @@ -609,7 +609,8 @@ components: result: type: string description: The result of quantum computation, set only if the computation is successful. - example: '{ "11": 4980, "00": 5020 }' + example: | + { "11": 4980, "00": 5020 } reason: type: string description: The reason indicating why there is no result diff --git a/backend/oas/user/schemas/jobs.yaml b/backend/oas/user/schemas/jobs.yaml index faec666..4652892 100644 --- a/backend/oas/user/schemas/jobs.yaml +++ b/backend/oas/user/schemas/jobs.yaml @@ -1,6 +1,6 @@ jobs.JobId: type: string - example: "7af020f6-2e38-4d70-8cf0-4349650ea08c" + example: 7af020f6-2e38-4d70-8cf0-4349650ea08c jobs.GetJobStatusResponse: description: job status @@ -29,7 +29,8 @@ jobs.JobInfoSampling: properties: job_type: type: string - enum: ["sampling"] + enum: + - sampling code: type: string example: >- @@ -51,7 +52,7 @@ jobs.JobInfoEstimation: job_type: type: string enum: - - "estimation" + - estimation code: type: string example: >- @@ -63,7 +64,7 @@ jobs.JobInfoEstimation: c = measure q; operator: type: string - example: "X 0 Y 1 Z 5 I 2" + example: X 0 Y 1 Z 5 I 2 required: - job_type - code @@ -92,17 +93,24 @@ jobs.JobInfo: result: type: string description: "The result of quantum computation, set only if the computation is successful." - example: '{ "11": 4980, "00": 5020 }' + example: | + { "11": 4980, "00": 5020 } reason: type: string - description: "The reason indicating why there is no result" + description: The reason indicating why there is no result required: - desc jobs.JobStatus: type: string - enum: ["submitted", "ready", "running", "success", "failed", "cancelled"] - example: "submitted" + enum: + - submitted + - ready + - running + - success + - failed + - cancelled + example: submitted jobs.TranspilerInfo: type: string @@ -141,9 +149,9 @@ jobs.MitigationInfo: jobs.JobType: type: string enum: - - "estimation" - - "sampling" - example: "sampling" + - estimation + - sampling + example: sampling jobs.JobDef: type: object @@ -152,10 +160,10 @@ jobs.JobDef: $ref: "#/jobs.JobId" name: type: string - example: "Bell State Sampling" + example: Bell State Sampling description: type: string - example: "Bell State Sampling Example" + example: Bell State Sampling Example job_type: $ref: "#/jobs.JobType" status: @@ -179,11 +187,11 @@ jobs.JobDef: created_at: type: string format: date-time - example: "2022-10-19T11:45:34Z" + example: 2022-10-19T11:45:34Z updated_at: type: string format: date-time - example: "2022-10-19T11:45:34Z" + example: 2022-10-19T11:45:34Z required: - job_id - name @@ -213,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 + updated_at: 2022-10-19T11:45:34 jobs.SubmitJobRequest: @@ -222,13 +230,13 @@ jobs.SubmitJobRequest: properties: name: type: string - example: "Bell State Sampling" + example: Bell State Sampling description: type: string - example: "An example of Bell state sampling job" + example: An example of Bell state sampling job device_id: type: string - example: "Kawasaki" + example: Kawasaki job_info: $ref: "#/jobs.JobInfoDesc" transpiler_info: diff --git a/backend/oqtopus_cloud/user/schemas/jobs.py b/backend/oqtopus_cloud/user/schemas/jobs.py index d426334..39a84bf 100644 --- a/backend/oqtopus_cloud/user/schemas/jobs.py +++ b/backend/oqtopus_cloud/user/schemas/jobs.py @@ -68,7 +68,9 @@ class JobInfo(BaseModel): ] ), ] = None - result: Annotated[str | None, Field(examples=['{ "11": 4980, "00": 5020 }'])] = None + result: Annotated[str | None, Field(examples=['{ "11": 4980, "00": 5020 }\n'])] = ( + None + ) """ The result of quantum computation, set only if the computation is successful. """