diff --git a/schemas/v1/QuantumHardwareDynamicDataResponse.schema.json b/schemas/v1/QuantumHardwareDynamicDataResponse.schema.json index 835465c..8895b36 100644 --- a/schemas/v1/QuantumHardwareDynamicDataResponse.schema.json +++ b/schemas/v1/QuantumHardwareDynamicDataResponse.schema.json @@ -2,6 +2,11 @@ "$defs": { "DynamicDataSchema": { "additionalProperties": true, + "examples": [ + { + "dynamic_key_1": "dynamic_value_1" + } + ], "title": "DynamicDataSchema", "type": "object" } @@ -26,12 +31,7 @@ "type": "string" }, "payload": { - "$ref": "#/$defs/DynamicDataSchema", - "examples": [ - { - "dynamic_key_1": "dynamic_value_1" - } - ] + "$ref": "#/$defs/DynamicDataSchema" } }, "required": [ diff --git a/schemas/v1/QuantumHardwareStaticDataResponse.schema.json b/schemas/v1/QuantumHardwareStaticDataResponse.schema.json index c0f7fe5..3307666 100644 --- a/schemas/v1/QuantumHardwareStaticDataResponse.schema.json +++ b/schemas/v1/QuantumHardwareStaticDataResponse.schema.json @@ -12,27 +12,7 @@ }, "topology": { "$ref": "#/$defs/Topology", - "description": "List of the edges between the various qubits", - "examples": [ - [ - [ - 0, - 1 - ], - [ - 1, - 2 - ], - [ - 2, - 0 - ], - [ - 3, - 2 - ] - ] - ] + "description": "List of the edges between the various qubits" }, "name": { "description": "Name of the system.", @@ -78,6 +58,26 @@ }, "Topology": { "description": "A class representing the topology of a quantum chip.\n\nIt is a list of tuples, where each tuple represents a unidirectional connection between two qubits. The first\nelement of the tuple is the source qubit, and the second element is the target qubit.", + "examples": [ + [ + [ + 0, + 1 + ], + [ + 1, + 2 + ], + [ + 2, + 0 + ], + [ + 3, + 2 + ] + ] + ], "items": { "maxItems": 2, "minItems": 2, diff --git a/schemas/v2/QuantumHardwareDynamicDataResponse.schema.json b/schemas/v2/QuantumHardwareDynamicDataResponse.schema.json index fb74c8f..8531074 100644 --- a/schemas/v2/QuantumHardwareDynamicDataResponse.schema.json +++ b/schemas/v2/QuantumHardwareDynamicDataResponse.schema.json @@ -2,6 +2,11 @@ "$defs": { "DynamicDataSchema": { "additionalProperties": true, + "examples": [ + { + "dynamic_key_1": "dynamic_value_1" + } + ], "title": "DynamicDataSchema", "type": "object" } @@ -26,12 +31,7 @@ "type": "string" }, "payload": { - "$ref": "#/$defs/DynamicDataSchema", - "examples": [ - { - "dynamic_key_1": "dynamic_value_1" - } - ] + "$ref": "#/$defs/DynamicDataSchema" } }, "required": [ diff --git a/schemas/v2/QuantumHardwareStaticDataResponse.schema.json b/schemas/v2/QuantumHardwareStaticDataResponse.schema.json index 290d0b6..9c5f646 100644 --- a/schemas/v2/QuantumHardwareStaticDataResponse.schema.json +++ b/schemas/v2/QuantumHardwareStaticDataResponse.schema.json @@ -163,27 +163,7 @@ }, "topology": { "$ref": "#/$defs/Topology", - "description": "List of the edges between the various qubits", - "examples": [ - [ - [ - 0, - 1 - ], - [ - 1, - 2 - ], - [ - 2, - 0 - ], - [ - 3, - 2 - ] - ] - ] + "description": "List of the edges between the various qubits" }, "name": { "description": "Name of the system.", @@ -305,6 +285,26 @@ }, "Topology": { "description": "A class representing the topology of a quantum chip.\n\nIt is a list of tuples, where each tuple represents a unidirectional connection between two qubits. The first\nelement of the tuple is the source qubit, and the second element is the target qubit.", + "examples": [ + [ + [ + 0, + 1 + ], + [ + 1, + 2 + ], + [ + 2, + 0 + ], + [ + 3, + 2 + ] + ] + ], "items": { "maxItems": 2, "minItems": 2, diff --git a/schemas/v3/QuantumHardwareDynamicDataResponse.schema.json b/schemas/v3/QuantumHardwareDynamicDataResponse.schema.json index b7809ee..d5a1543 100644 --- a/schemas/v3/QuantumHardwareDynamicDataResponse.schema.json +++ b/schemas/v3/QuantumHardwareDynamicDataResponse.schema.json @@ -2,6 +2,11 @@ "$defs": { "DynamicDataSchema": { "additionalProperties": true, + "examples": [ + { + "dynamic_key_1": "dynamic_value_1" + } + ], "title": "DynamicDataSchema", "type": "object" } @@ -17,12 +22,7 @@ "type": "string" }, "payload": { - "$ref": "#/$defs/DynamicDataSchema", - "examples": [ - { - "dynamic_key_1": "dynamic_value_1" - } - ] + "$ref": "#/$defs/DynamicDataSchema" }, "session_id": { "examples": [ diff --git a/schemas/v3/QuantumHardwareStaticDataResponse.schema.json b/schemas/v3/QuantumHardwareStaticDataResponse.schema.json index 4447b25..e93a50c 100644 --- a/schemas/v3/QuantumHardwareStaticDataResponse.schema.json +++ b/schemas/v3/QuantumHardwareStaticDataResponse.schema.json @@ -162,27 +162,7 @@ }, "topology": { "$ref": "#/$defs/Topology", - "description": "List of the edges between the various qubits", - "examples": [ - [ - [ - 0, - 1 - ], - [ - 1, - 2 - ], - [ - 2, - 0 - ], - [ - 3, - 2 - ] - ] - ] + "description": "List of the edges between the various qubits" }, "name": { "description": "Name of the system.", @@ -305,6 +285,26 @@ }, "Topology": { "description": "A class representing the topology of a quantum chip.\n\nIt is a list of tuples, where each tuple represents a unidirectional connection between two qubits. The first\nelement of the tuple is the source qubit, and the second element is the target qubit.", + "examples": [ + [ + [ + 0, + 1 + ], + [ + 1, + 2 + ], + [ + 2, + 0 + ], + [ + 3, + 2 + ] + ] + ], "items": { "maxItems": 2, "minItems": 2, diff --git a/tests/control-software-validator/models/QuantumHardwareDynamicDataResponse.py b/tests/control-software-validator/models/QuantumHardwareDynamicDataResponse.py index bd9c3d2..3e1ddf0 100644 --- a/tests/control-software-validator/models/QuantumHardwareDynamicDataResponse.py +++ b/tests/control-software-validator/models/QuantumHardwareDynamicDataResponse.py @@ -18,9 +18,7 @@ class DynamicDataSchema(BaseModel): class QuantumHardwareDynamicDataResponse(BaseModel): status: Literal['success'] = Field(..., examples=['success'], title='Status') - payload: DynamicDataSchema = Field( - ..., examples=[{'dynamic_key_1': 'dynamic_value_1'}] - ) + payload: DynamicDataSchema session_id: UUID = Field( ..., examples=['8e7e2b6c-2b3c-4d9f-8b12-6a4d9b1e3f5a'], title='Session Id' ) diff --git a/tests/control-software-validator/models/QuantumHardwareStaticDataResponse.py b/tests/control-software-validator/models/QuantumHardwareStaticDataResponse.py index 459d0d0..ede0c9c 100644 --- a/tests/control-software-validator/models/QuantumHardwareStaticDataResponse.py +++ b/tests/control-software-validator/models/QuantumHardwareStaticDataResponse.py @@ -38,6 +38,7 @@ class Topology(RootModel[List[TopologyItem]]): root: List[TopologyItem] = Field( ..., description='A class representing the topology of a quantum chip.\n\nIt is a list of tuples, where each tuple represents a unidirectional connection between two qubits. The first\nelement of the tuple is the source qubit, and the second element is the target qubit.', + examples=[[[0, 1], [1, 2], [2, 0], [3, 2]]], title='Topology', ) @@ -109,9 +110,7 @@ class StaticDataSchema(BaseModel): ..., description='The number of qubits.', examples=[3], title='Nqubits' ) topology: Topology = Field( - ..., - description='List of the edges between the various qubits', - examples=[[[0, 1], [1, 2], [2, 0], [3, 2]]], + ..., description='List of the edges between the various qubits' ) name: str = Field( ..., description='Name of the system.', examples=['Spin2'], title='Name' diff --git a/tests/control-software-validator/requirements.txt b/tests/control-software-validator/requirements.txt index 99ccf0d..2914b08 100644 --- a/tests/control-software-validator/requirements.txt +++ b/tests/control-software-validator/requirements.txt @@ -1,5 +1,5 @@ pytest==8.3.5 -pydantic==2.11.3 +pydantic==2.13.4 datamodel-code-generator==0.28.4 pyzmq==26.3.0 pytest-asyncio==0.25.0