Skip to content

Commit faba464

Browse files
Update Python and TypeScript bindings.
1 parent faec36c commit faba464

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

shared-data/js/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ export interface LabwareDefinition2 {
263263

264264
export interface LabwareDefinition3 {
265265
version: number
266+
$otSharedSchema: '#/labware/schemas/3'
266267
schemaVersion: 3
267268
namespace: string
268269
metadata: LabwareMetadata

shared-data/python/opentrons_shared_data/labware/labware_definition.py

+12
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,18 @@ class InnerWellGeometry(BaseModel):
684684

685685

686686
class LabwareDefinition(BaseModel):
687+
model_config = {
688+
# `"extra": "allow"` gives us lossless preservation of the $otSharedSchema field
689+
# (which should always be omitted in schema 2 and always be present in schema 3)
690+
# across parse/serialize round trips. Pydantic doesn't seem to have a good way
691+
# of doing that when the $otSharedSchema field is declared explicitly on this
692+
# model.
693+
#
694+
# Splitting this model into separate ones for schema 2 and 3 would also solve this.
695+
"extra": "allow"
696+
}
697+
698+
# $otSharedSchema deliberately omitted for now. See `"extra": "allow"` in model_config.
687699
schemaVersion: Literal[1, 2, 3] = Field(
688700
..., description="Which schema version a labware is using"
689701
)

shared-data/python/opentrons_shared_data/labware/types.py

+2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ class WellGroup(TypedDict, total=False):
125125

126126

127127
class LabwareDefinition(TypedDict):
128+
# $otSharedSchema omitted because the dollar sign makes it annoying to include
129+
# here and nothing needs it yet, anyway.
128130
schemaVersion: Literal[2, 3]
129131
version: int
130132
namespace: str

0 commit comments

Comments
 (0)