Skip to content

add error_msg to BaseReply failure schema #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion schemas/get_dynamic/reply_failure.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@
"const": "failure",
"title": "Status",
"type": "string"
},
"payload": {
"properties": {
"error_msg": {
"description": "A descriptive error message to be passed on to the user.",
"title": "Error Msg",
"type": "string"
}
},
"required": [
"error_msg"
],
"title": "QuantumHardwareFailureData",
"type": "object"
}
},
"required": [
Expand All @@ -18,4 +32,4 @@
],
"title": "Hardware data failure",
"type": "object"
}
}
16 changes: 15 additions & 1 deletion schemas/get_static/reply_failure.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@
"const": "failure",
"title": "Status",
"type": "string"
},
"payload": {
"properties": {
"error_msg": {
"description": "A descriptive error message to be passed on to the user.",
"title": "Error Msg",
"type": "string"
}
},
"required": [
"error_msg"
],
"title": "QuantumHardwareFailureData",
"type": "object"
}
},
"required": [
Expand All @@ -18,4 +32,4 @@
],
"title": "Hardware data failure",
"type": "object"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@

from __future__ import annotations

from typing import Literal
from typing import Literal, Optional

from pydantic import BaseModel, Field


class Payload(BaseModel):
error_msg: str = Field(
...,
description='A descriptive error message to be passed on to the user.',
title='Error Msg',
)


class GetDynamicReplyFailure(BaseModel):
version: str = Field(..., pattern='^\\d+\\.\\d+\\.\\d$', title='Version')
status: Literal['failure'] = Field(..., title='Status')
payload: Optional[Payload] = Field(None, title='QuantumHardwareFailureData')
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@

from __future__ import annotations

from typing import Literal
from typing import Literal, Optional

from pydantic import BaseModel, Field


class Payload(BaseModel):
error_msg: str = Field(
...,
description='A descriptive error message to be passed on to the user.',
title='Error Msg',
)


class GetStaticReplyFailure(BaseModel):
version: str = Field(..., pattern='^\\d+\\.\\d+\\.\\d$', title='Version')
status: Literal['failure'] = Field(..., title='Status')
payload: Optional[Payload] = Field(None, title='QuantumHardwareFailureData')