From 8caf20b329db4876c79c185906e01529caeb5ee1 Mon Sep 17 00:00:00 2001 From: Peter Selby Date: Fri, 7 Aug 2026 17:23:51 -0400 Subject: [PATCH] fixes issue #593 --- .../BrAPI-Germplasm/Germplasm.json | 29 +++++++++++++++++++ .../BrAPI-Schema/BrAPI-Phenotyping/Image.json | 6 ++++ generator/openapi-options.yaml | 4 +++ 3 files changed, 39 insertions(+) diff --git a/Specification/BrAPI-Schema/BrAPI-Germplasm/Germplasm.json b/Specification/BrAPI-Schema/BrAPI-Germplasm/Germplasm.json index 3d372c6f..8192721c 100644 --- a/Specification/BrAPI-Schema/BrAPI-Germplasm/Germplasm.json +++ b/Specification/BrAPI-Schema/BrAPI-Germplasm/Germplasm.json @@ -200,6 +200,13 @@ "referencedAttribute": "germplasm", "relationshipType": "one-to-one" }, + "media": { + "description": "Descriptive images of a model example for a particular germplasm", + "type": ["null", "array"], + "items": { + "$ref": "Germplasm.json#/$defs/GermplasmMedia" + } + }, "pedigree": { "description": "The cross name and optional selection history.\n\nMCPD (v2.1) (ANCEST) 20. Information about either pedigree or other description of ancestral information (e.g. parent variety in case of mutant or selection). For example a pedigree 'Hanna/7*Atlas//Turk/8*Atlas' or a description 'mutation found in Hanna', 'selection from Irene' or 'cross involving amongst others Hanna and Irene'.", "type": [ @@ -1012,6 +1019,28 @@ "brapi-metadata": { "primaryModel": false } + }, + "GermplasmMedia":{ + "title": "GermplasmMedia", + "type": "object", + "brapi-metadata": { + "primaryModel": false + }, + "description": "Descriptive images of a model example for a particular germplasm", + "properties": { + "image": { + "description": "associated image reference", + "$ref": "../BrAPI-Phenotyping/Image.json#/$defs/Image", + "relationshipType": "one-to-one", + "referencedAttribute": "germplasmMedia" + }, + "imageURL": { + "descritpion": "URL of the image file", + "type": ["null", "string"], + "format": "url", + "examples": ["http://foo.bar/baz.png"] + } + } } }, "$id": "https://brapi.org/Specification/BrAPI-Schema/BrAPI-Germplasm/Germplasm.json", diff --git a/Specification/BrAPI-Schema/BrAPI-Phenotyping/Image.json b/Specification/BrAPI-Schema/BrAPI-Phenotyping/Image.json index dbd5f4a4..43e36d4a 100644 --- a/Specification/BrAPI-Schema/BrAPI-Phenotyping/Image.json +++ b/Specification/BrAPI-Schema/BrAPI-Phenotyping/Image.json @@ -135,6 +135,12 @@ "referencedAttribute": "images", "relationshipType": "one-to-many", "type": ["null", "array"] + }, + "germplasmMedia": { + "description": "A list of observation Ids this image is associated with, if applicable.", + "$ref": "../BrAPI-Germplasm/Germplasm.json#/$defs/GermplasmMedia", + "referencedAttribute": "image", + "relationshipType": "one-to-one" } }, "required": [ diff --git a/generator/openapi-options.yaml b/generator/openapi-options.yaml index e32ed078..2568b789 100644 --- a/generator/openapi-options.yaml +++ b/generator/openapi-options.yaml @@ -41,6 +41,10 @@ properties: linkPropertyFor: Observation: uploadedByPerson: false + GermplasmMedia: + image: false linkTypeFor: Person: observations: none + Image: + germplasmMedia: none