File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
python/opentrons_shared_data/labware Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,7 @@ export interface LabwareDefinition2 {
263
263
264
264
export interface LabwareDefinition3 {
265
265
version : number
266
+ $otSharedSchema : '#/labware/schemas/3'
266
267
schemaVersion : 3
267
268
namespace : string
268
269
metadata : LabwareMetadata
Original file line number Diff line number Diff line change @@ -684,6 +684,18 @@ class InnerWellGeometry(BaseModel):
684
684
685
685
686
686
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.
687
699
schemaVersion : Literal [1 , 2 , 3 ] = Field (
688
700
..., description = "Which schema version a labware is using"
689
701
)
Original file line number Diff line number Diff line change @@ -125,6 +125,8 @@ class WellGroup(TypedDict, total=False):
125
125
126
126
127
127
class LabwareDefinition (TypedDict ):
128
+ # $otSharedSchema omitted because the dollar sign makes it annoying to include
129
+ # here and nothing needs it yet, anyway.
128
130
schemaVersion : Literal [2 , 3 ]
129
131
version : int
130
132
namespace : str
You can’t perform that action at this time.
0 commit comments