Skip to content

Instantly share code, notes, and snippets.

@pvogel1967
Last active August 6, 2019 21:41
Show Gist options
  • Save pvogel1967/4c073c496215e539996ba9fc7a37c715 to your computer and use it in GitHub Desktop.
Save pvogel1967/4c073c496215e539996ba9fc7a37c715 to your computer and use it in GitHub Desktop.
schema
{
"description": "This is the meta schema for all Intuit IEDM type and service definitions.",
"id": "https://iedmschema.s3-us-west-2.amazonaws.com/Schema.json#",
"$schema": "#",
"definitions": {
"IedmPropertyAttributes": {
"description": "Defines the attributes of an IEDM type's fields",
"type": "object",
"required": [
"description"
],
"properties": {
"description": {
"description": "a detailed semantic description of this field, how its value affects the behavior of the system, DO NOT simply restate the field name or leave this blank",
"type": "string"
},
"access": {
"description": "indicates whether the given property can be accessed by 3rd parties or is restricted to internal use",
"$ref": "#/definitions/AccessLevel"
},
"readonly": {
"description": "Indicates the field should not appear in input types, only output types",
"type": "boolean",
"default": false
},
"classification": {
"description": "The Data Classification Level for this schema, directly implying the security measures that must be employed wherever the data is stored, processed or transmitted",
"$ref": "#/definitions/DataClassificationLevel"
},
"isPersonalData": {
"description": "Indication of whether or not this schema describes Personal Data. See \"DEF-1 Personal Data\" at https://docs.google.com/document/d/1Ww9B_AQkPT7Y8esNkMtCNH4w582VNhYru73R6QtLk40/edit?usp=sharing",
"type": "boolean"
},
"isPii": {
"description": "Indication of whether or not this schema describes Personally Identifiable Information, a more narrow sub-category of Personal Data. See \"DEF-1.1.9\" at https://docs.google.com/document/d/1Ww9B_AQkPT7Y8esNkMtCNH4w582VNhYru73R6QtLk40/edit?usp=sharing",
"type": "boolean"
},
"queryable": {
"description": "indicates whether the given field should be represented in a criteria object for the containing type",
"type": "boolean",
"default": false
},
"refDepth": {
"description": "If a field is referencing another entity, this indicates how deep the containing object 'owns' rendering the referenced object, 0 is ID only, n follows all references until there are no further references to follow",
"type": "string",
"default": "0"
},
"deprecated": {
"description": "If present, the field is DEPRECATED, the string value is required and should indicate the reason for deprecation and the recommended replacement for any system which relied on the deprecated field",
"type": "string"
},
"removed": {
"description": "If present, the field has been REMOVED from use (it must also have a string for deprecated), the string value is required and indicatesd the date as of which the field was removed from the API. Note: you can never fully remove a field (backward compatibility must be enforced)",
"type": "string",
"format": "date"
},
"format": {
"description": "If type is a string, you can constrain the formats of that string",
"$ref": "#/definitions/format"
}
}
},
"AccessLevel": {
"description": "Defines the level of access for 3rd parties to the given type or property",
"type": "string",
"enum": [
"EXTERNAL_PROD",
"EXTERNAL_BETA",
"INTERNAL"
],
"default": "INTERNAL"
},
"DataClassificationLevel": {
"description": "Defines the Intuit data classification protection level of an entity or property",
"type": "string",
"enum": [
"PUBLIC",
"RESTRICTED",
"SENSITIVE",
"HIGHLY_SENSITIVE",
"SECRET"
],
"title": "Data Classification Level",
"default": "SECRET"
},
"format": {
"description": "These are the valid string formats that Intuit accepts",
"enum": [
"date-time",
"date",
"int32",
"uint32",
"int64",
"uint64",
"float",
"double",
"decimal",
"ID"
]
},
"schemaArray": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#" }
},
"nonNegativeInteger": {
"type": "integer",
"minimum": 0
},
"nonNegativeIntegerDefault0": {
"allOf": [
{ "$ref": "#/definitions/nonNegativeInteger" },
{ "default": 0 }
]
},
"simpleTypes": {
"enum": [
"array",
"boolean",
"integer",
"null",
"number",
"object",
"string"
]
},
"stringArray": {
"type": "array",
"items": { "type": "string" },
"uniqueItems": true,
"default": []
}
},
"properties": {
"intent": {
"description": "The intent of this schema -- is it a SERVICE description, an INTERFACE type (abstract type), or a concrete TYPE",
"type": "string",
"enum": [
"SERVICE",
"INTERFACE",
"TYPE"
],
"default": "TYPE"
}
},
"if": {
"properties": {
"intent": {
"const": "SERVICE"
}
}
},
"then": {
"required": [
"description"
],
"properties": {
"description": {
"description": "A description of the service",
"type": "string"
},
"publishedEntities": {
"description": "an array list of references to entity types that are published by this service",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"$ref"
],
"properties": {
"$ref": {
"type": "string",
"format": "uri-reference"
},
"additionalProperties": false
}
}
},
"operations": {
"description": "the set of operations implemented by this service, their inputs, outputs, and how they should fit into the broader graph at the API layer",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^[a-z][A-Za-z0-9]*$": {
"type": "object",
"required": [
"output",
"input",
"behavior",
"nodeQuery"
],
"additionalProperties": false,
"properties": {
"output": {
"description": "The output (response) type for this operation",
"type": "object"
},
"input": {
"description": "The input (request) type for this operation",
"type": "object"
},
"behavior": {
"description": "The GraphQL behavior of this operation",
"enum": [
"QUERY",
"MUTATION",
"SUBSCRIPTION"
]
},
"nodeQuery": {
"description": "Indicates whether this is THE operation by which the a single instance of the output type (which must be an entity) is obtained by ID",
"type": "boolean"
},
"nodesQuery": {
"description": "Indicates whether this is THE operation by which multiple instances of the output type (which must be an entity) are read by ID",
"type": "boolean"
},
"extends": {
"description": "For an operation whose behavior is QUERY, indicates the location(s) within the graph where the operation should be exposed. If left off, the operation will be exposed by name in the GraphQL root Query object",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"$ref"
],
"properties": {
"$ref": {
"type": "string",
"format": "uri-reference"
},
"as": {
"description": "by default, the name of the operation will be the field name within the extended object that invokes this operation, to use a different field name, specify it here",
"type": "string"
},
"inputMap": {
"type": "object",
"patternProperties": {
"^[a-z][A-Za-z0-9]*$": {
"type": "string"
}
},
"additionalProperties": false
}
}
}
}
}
}
}
}
}
},
"else": {
"required": [
"typeGuid",
"description",
"access",
"classification",
"isPersonalData",
"isPii"
],
"allOf": [{"$ref": "http://json-schema.org/draft-07/schema#"}],
"properties": {
"typeGuid": {
"description": "unique GUID for the type, used to uniquely identify the type in global IDs instead of relying on the folder location of the schema definition",
"type": "string"
},
"description": {
"description": "a detailed semantic description of this type",
"type": "string"
},
"access": {
"description": "indicates whether the type defined by this schema can be accessed by 3rd parties or is restricted to internal use",
"$ref": "#/definitions/AccessLevel"
},
"classification": {
"description": "The Data Classification Level for this schema, directly implying the security measures that must be employed wherever the data is stored, processed or transmitted",
"$ref": "#/definitions/DataClassificationLevel"
},
"isPersonalData": {
"description": "Indication of whether or not this schema describes Personal Data. See \"DEF-1 Personal Data\" at https://docs.google.com/document/d/1Ww9B_AQkPT7Y8esNkMtCNH4w582VNhYru73R6QtLk40/edit?usp=sharing",
"type": "boolean"
},
"isPii": {
"description": "Indication of whether or not this schema describes Personally Identifiable Information, a more narrow sub-category of Personal Data. See \"DEF-1.1.9\" at https://docs.google.com/document/d/1Ww9B_AQkPT7Y8esNkMtCNH4w582VNhYru73R6QtLk40/edit?usp=sharing",
"type": "boolean"
},
"deprecated": {
"description": "If present, the entire TYPE is DEPRECATED, the string value is required and should indicate the reason for deprecation and the recommended replacement for any system which relied on the deprecated type",
"type": "string"
},
"patternProperties": {
"^[a-z][A-Za-z0-9]*$": {
"$ref": "#/definitions/IedmPropertyAttributes"
}
},
"additionalProperties": false
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment