From 93c8e720b7a7f1d4d2d89d5b68d143d02be5243a Mon Sep 17 00:00:00 2001 From: Shlok Amin Date: Tue, 11 Jun 2024 16:29:45 -0400 Subject: [PATCH 1/4] feat(shared-data): add labware respsitory JSON interface --- shared-data/labware/repository/schemas/1.json | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 shared-data/labware/repository/schemas/1.json diff --git a/shared-data/labware/repository/schemas/1.json b/shared-data/labware/repository/schemas/1.json new file mode 100644 index 00000000000..03c9407e612 --- /dev/null +++ b/shared-data/labware/repository/schemas/1.json @@ -0,0 +1,61 @@ +{ + "$id": "opentronsLabwareRepositorySchemaV1", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "format": "This schema defines an the labware repository interface. It must be keyed by labware def uri, with values representing each labware's data", + "patternProperties": { + "^[0-9a-fA-F-]{36}$": { + "type": "object", + "properties": { + "labwareDefUri": { + "type": "string", + "format": "labware definition uri" + }, + "definitionPath": { + "type": "string", + "description": "a path to the labware definition relative to the index file’s containing directory" + }, + "additionalContent": { + "type": "array", + "description": "additional metadata for file contents for this labware", + "items": { + "type": "object", + "properties": { + "contentMimeType": { + "type": "string" + }, + "semanticType": { + "type": "string", + "enum": [ + "orthographicViewImage", + "topViewImage", + "longSideViewImage", + "shortSideViewImage" + ] + }, + "contentPath": { + "type": "string" + } + }, + "required": ["contentMimeType", "semanticType", "contentPath"] + } + }, + "lastEditTimestamp": { + "type": "string", + "format": "date-time" + }, + "valid": { + "type": "boolean" + } + }, + "required": [ + "labwareDefUri", + "definitionPath", + "additionalContent", + "lastEditTimestamp", + "valid" + ] + } + }, + "additionalProperties": false +} From 7cede37643c857b92eb20405a3bee2a4406797be Mon Sep 17 00:00:00 2001 From: Shlok Amin Date: Tue, 11 Jun 2024 16:32:39 -0400 Subject: [PATCH 2/4] fix typo in description --- shared-data/labware/repository/schemas/1.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-data/labware/repository/schemas/1.json b/shared-data/labware/repository/schemas/1.json index 03c9407e612..59276d3f7e2 100644 --- a/shared-data/labware/repository/schemas/1.json +++ b/shared-data/labware/repository/schemas/1.json @@ -2,7 +2,7 @@ "$id": "opentronsLabwareRepositorySchemaV1", "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", - "format": "This schema defines an the labware repository interface. It must be keyed by labware def uri, with values representing each labware's data", + "format": "This schema defines the labware repository interface. It must be keyed by labware def uri, with values representing each labware's data", "patternProperties": { "^[0-9a-fA-F-]{36}$": { "type": "object", From 6e570fdba2d079ae03e94b78a1e608acbe7f0633 Mon Sep 17 00:00:00 2001 From: Shlok Amin Date: Wed, 12 Jun 2024 09:26:17 -0400 Subject: [PATCH 3/4] add top level metadata field --- shared-data/labware/repository/schemas/1.json | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/shared-data/labware/repository/schemas/1.json b/shared-data/labware/repository/schemas/1.json index 59276d3f7e2..c7878916482 100644 --- a/shared-data/labware/repository/schemas/1.json +++ b/shared-data/labware/repository/schemas/1.json @@ -2,7 +2,27 @@ "$id": "opentronsLabwareRepositorySchemaV1", "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", - "format": "This schema defines the labware repository interface. It must be keyed by labware def uri, with values representing each labware's data", + "format": "This schema defines the labware repository interface. Labware entries must be keyed by labware def uri, with values representing each labware's data", + "properties": { + "metadata": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "name of the labware repository" + }, + "owner": { + "type": "string", + "description": "owner of the labware repository" + }, + "lastModifiedDate": { + "type": "string", + "format": "date-time" + } + }, + "required": ["name", "owner", "lastModifiedDate"] + } + }, "patternProperties": { "^[0-9a-fA-F-]{36}$": { "type": "object", From e4a0edb3111a72607a5cab69c977248e0b1bf789 Mon Sep 17 00:00:00 2001 From: Shlok Amin Date: Mon, 24 Jun 2024 13:45:54 -0400 Subject: [PATCH 4/4] add fixture --- .../fixtures/1/exampleLabwareRepository.json | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 shared-data/labware/repository/fixtures/1/exampleLabwareRepository.json diff --git a/shared-data/labware/repository/fixtures/1/exampleLabwareRepository.json b/shared-data/labware/repository/fixtures/1/exampleLabwareRepository.json new file mode 100644 index 00000000000..2a74a39b000 --- /dev/null +++ b/shared-data/labware/repository/fixtures/1/exampleLabwareRepository.json @@ -0,0 +1,43 @@ +{ + "metadata": { + "name": "Example Labware Repository", + "owner": "Opentrons Example App", + "lastModifiedDate": "2024-06-11T15:00:00Z" + }, + "123e4567-e89b-12d3-a456-426614174000": { + "labwareUri": "http://example.com/labware/123e4567-e89b-12d3-a456-426614174000", + "definitionPath": "definitions/labware1.json", + "additionalContent": [ + { + "contentMimeType": "image/png", + "semanticType": "topViewImage", + "contentPath": "images/labware1_top.png" + }, + { + "contentMimeType": "image/png", + "semanticType": "orthographicViewImage", + "contentPath": "images/labware1_ortho.png" + } + ], + "lastEditTimestamp": "2024-06-10T12:00:00Z", + "valid": true + }, + "223e4567-e89b-12d3-a456-426614174001": { + "labwareUri": "http://example.com/labware/223e4567-e89b-12d3-a456-426614174001", + "definitionPath": "definitions/labware2.json", + "additionalContent": [ + { + "contentMimeType": "image/jpeg", + "semanticType": "longSideViewImage", + "contentPath": "images/labware2_long.jpg" + }, + { + "contentMimeType": "image/jpeg", + "semanticType": "shortSideViewImage", + "contentPath": "images/labware2_short.jpg" + } + ], + "lastEditTimestamp": "2024-06-10T13:00:00Z", + "valid": false + } +}