scitran/core

View on GitHub
swagger/schemas/definitions/subject.json

Summary

Maintainability
Test Coverage
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions":{
        "_id":              {"$ref":"common.json#/definitions/objectid"},
        "firstname":        { "type": "string", "maxLength": 64 },
        "lastname":         { "type": "string", "maxLength": 64 },
        "age":              { "type": ["integer", "null"] },
        "sex": { 
            "oneOf": [
                            { "type": "null"},
                            { "type": "string", "enum": ["male", "female", "other", "unknown"] }
            ]
        },
        "race": {
            "oneOf": [
                            { "type": "null"},
                            { "type": "string", "enum": ["American Indian or Alaska Native", "Asian", "Native Hawaiian or Other Pacific Islander", "Black or African American", "White", "More Than One Race", "Unknown or Not Reported"] }
            ]
        },
        "ethnicity": {
            "oneOf": [
                            { "type": "null"},
                            { "type": "string", "enum": ["Not Hispanic or Latino", "Hispanic or Latino", "Unknown or Not Reported"] }
            ]
        },
        "code":             { "type": "string", "maxLength": 64 },
        "tags":             { "type": "array", "items": {"type": "string"} },
        "subject-input":{
            "type": "object",
            "properties": {
              "_id":              {"$ref":"#/definitions/_id"},
              "firstname":        {"$ref":"#/definitions/firstname"},
              "lastname":         {"$ref":"#/definitions/lastname"},

              "age":              {"$ref":"#/definitions/age"},
              "sex":              {"$ref":"#/definitions/sex"},
              "race":             {"$ref":"#/definitions/race"},
              "ethnicity":        {"$ref":"#/definitions/ethnicity"},

              "code":             {"$ref":"#/definitions/code"},
              "tags":             {"$ref":"#/definitions/tags"},
              "info":             {"$ref":"common.json#/definitions/info"},
              "files":{
                  "type":"array",
                  "items":{"$ref":"file.json#/definitions/file-input"}
              }
            },
            "additionalProperties": false,
            "x-sdk-model": "subject"
        },
        "subject-output":{
            "type": "object",
            "properties": {
              "_id":              {"$ref":"#/definitions/_id"},
              "firstname":        {"$ref":"#/definitions/firstname"},
              "lastname":         {"$ref":"#/definitions/lastname"},

              "age":              {"$ref":"#/definitions/age"},
              "sex":              {"$ref":"#/definitions/sex"},
              "race":             {"$ref":"#/definitions/race"},
              "ethnicity":        {"$ref":"#/definitions/ethnicity"},

              "code":             {"$ref":"#/definitions/code"},
              "tags":             {"$ref":"#/definitions/tags"},
              "info":             {"$ref":"common.json#/definitions/info"},
              "info_exists":      {"$ref":"container.json#/definitions/info_exists"},
              "files":{
                  "type":"array",
                  "items":{"$ref":"file.json#/definitions/file-output"}
              }
            },
            "additionalProperties": false,
            "x-sdk-model": "subject"
        },
        "subject-output-default-required":{
            "allOf":[{"$ref":"#/definitions/subject-output"}],
            "required":["_id"],
            "x-sdk-model": "subject"
        }
    }
}