...
Code Block |
---|
root/schemas/org/sagebionetworks/entity/type/Example.json root/schemas/org/sagebionetworks/annotation/types/BioOntologyTissueTypeVertebrateOrganType.json |
Folder entities will be created as need to create each path. By giving each SchemaEntity a unique path, we can use this path to reference a schema before we have an entity to represent it.
...
We want to add a new required primary field called "status". Since "status" is required, we must provide a default value. This is a requirement because we already have instances of Example entities deployed to Synapse, and each of these must be given a default value. We will cover how these default values are applied shortly. Here is our new Example.json:
Example.json
Code Block |
---|
{ "extends":"org/sagebionetworks/entity/type/Entity.json" "name":"Product", "properties":{ "id":{ "type":"number", "description":"Example identifier", "required":true }, "name":{ "description":"Name of the Example", "type":"string", "required":true }, "statusorgan":{ "type$ref":"string"org/sagebionetworks/annotation/types/VertebrateOrganType.json" }, "requiredstatus":true, "enum":[ "PROTOTYPE", "RELEASED", "RECALLED", "DEPRECIATED"], "default":"PROTOTYPE"{ "type":"string", "required":true, "enum":[ "PROTOTYPE", "RELEASED", "RECALLED", "DEPRECIATED" ], }, }, "additionalProperties":{ "tissue":{ "typedefault":"objectPROTOTYPE", "$ref":"org/sagebionetworks/annotation/types/BioOntologyTissueType.json" } } } |
Compile POJOs (Nth Time)
This time when we compile the new Example.java POJO, the resulting POJO will have a new field called "status" with a default value of "PROTYPE".
...