{"openapi":"3.0.1","info":{"title":"Attribute Validator","description":"Validates attribute selections against a rule set, returning the result of the engine&#39;s validate() function.\n","termsOfService":"https://cimpress-support.atlassian.net/wiki/spaces/FALCON/pages/15743026370/Tier+3+Support+Process","contact":{"name":"CT Product Tribe","email":"CTProductCatalogSupport@cimpress.com"},"version":"0.0.1"},"servers":[{"url":"/"}],"security":[{"auth0AccessToken":[]},{"cimpressAccessToken":[]}],"paths":{"/livecheck":{"get":{"tags":["Livecheck"],"summary":"Runs a healthcheck to ensure that the service is running.","operationId":"getLivecheck","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}},"head":{"tags":["Livecheck"],"summary":"Runs a healthcheck to ensure that the service is running.","operationId":"headLivecheck","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/ruleSets:validate":{"post":{"tags":["v1"],"summary":"Validates the variable selections against the provided ruleSet.","operationId":"ValidateRuleSet","requestBody":{"description":"The validation request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CT.Products.Client.RulesExecutor.Models.ValidationRequest"}}},"required":true},"responses":{"200":{"description":"Attribute selection is valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CT.Products.Client.RulesExecutor.Models.ValidationResponse"}}}},"400":{"description":"The attribute selection or rule set were malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MalformedValidationRequestError"}}}}},"x-codegen-request-body-name":"validationRequest"}},"/v1/ruleSets/{referenceId}:validate":{"get":{"tags":["v1"],"summary":"Validates attributes against a ruleSet. This service can not be used by swagger and must be integrated via the API.\r\nIt expects a list of query parameters that represent the name value pairs of the variables to be validated.\r\nFor example v1/ruleSets/CIM-123456:validate?width-cm=10&amp;height-cm=50&amp;quantity=500","operationId":"ValidateAttributesByReferenceId","parameters":[{"name":"referenceId","in":"path","description":"The Rule Set's reference ID. We assume this reference ID is associated with either an Authoritative Rule Set or only one Rule Set.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Attribute selection is valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CT.Products.Client.RulesExecutor.Models.ValidationResponse"}}}},"400":{"description":"The attribute selection was malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MalformedValidationRequestError"}}}},"404":{"description":"There is no rule set for the given reference id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleSetNotFoundError"}}}}}},"post":{"tags":["v1"],"summary":"Validates the variable selections against a ruleSet, with support for pre-filtering the rule set.","operationId":"ValidateRuleSetByReferenceId","parameters":[{"name":"referenceId","in":"path","description":"The Rule Set's reference ID. We assume this reference ID is associated with either an Authoritative Rule Set or only one Rule Set.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The validation request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilteredValidationRequest"}}},"required":true},"responses":{"200":{"description":"Attribute selection is valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CT.Products.Client.RulesExecutor.Models.ValidationResponse"}}}},"400":{"description":"The attribute selection or rule set were malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MalformedValidationRequestError"}}}}},"x-codegen-request-body-name":"validationRequest"},"head":{"tags":["v1"],"summary":"Get header information regarding resolving attribute selections against a v1/ruleSets.","description":"Information regarding attribute resolution for /v1/ruleSets.","operationId":"headV2RuleSetValidatedAttributes","parameters":[{"name":"referenceId","in":"path","description":"The Rule Set's reference ID. We assume this reference ID is associated with either an Authoritative Rule Set or only one Rule Set.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The rule set exists. Empty body return.","headers":{"Rule-Set-Last-Modified":{"description":"Last modified date for the rule set resolved against","schema":{"type":"string"}},"Rules-Engine-Version":{"description":"Version of the Rules Engine that the attributes are resolved against","schema":{"type":"string"}},"Isolated-Property-Assignments-Last-Modified":{"description":"Last modified date for the Isolated Property Assignments resolved against, if the rule set has them.","schema":{"type":"string"}}},"content":{}},"404":{"description":"There is no rule set for the given reference id.","content":{"*/*":{"schema":{"$ref":"#/components/schemas/RuleSetNotFoundError"}}}}}}},"/v0/products/{productId}/versions/{version}:validate":{"post":{"tags":["v1"],"summary":"Validates variable selections against a product of a specific version, with support for pre-filtering the product using the Rule Set Filter format. Responds in the Rule Set Validation format.","operationId":"ValidateProductByReferenceIdWithRuleSetFilterAndResponse","parameters":[{"name":"productId","in":"path","description":"The Product's ID.","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","description":"The version of the product.","required":true,"schema":{"type":"string"}}],"requestBody":{"description":"The validation request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilteredValidationRequest"}}},"required":true},"responses":{"200":{"description":"Attribute selection is valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductValidationResponseAsRuleSetResponse"}}}},"400":{"description":"The attribute selection or rule set were malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MalformedValidationRequestError"}}}}},"x-codegen-request-body-name":"validationRequest"}},"/v1/attributeModels:validate":{"post":{"tags":["v1"],"summary":"Validates variable selections against an attribute model. Responds with validity and the remaining valid values for the queried attributes.","operationId":"validateAttributeModel","requestBody":{"description":"The request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelValidationRequest"}}},"required":true},"responses":{"200":{"description":"The validation completed successfully.  The response details the validity of the selections and the remaining options for queried attributes.","content":{"applicationJson":{"schema":{"$ref":"#/components/schemas/ModelValidationResponse"}}}},"400":{"description":"Either the request was malformed OR a selected attribute was also queried.","content":{"applicationJson":{"schema":{"$ref":"#/components/schemas/BadRequestError"}}}}},"x-codegen-request-body-name":"modelValidationRequest"}}},"components":{"schemas":{"ModelValidationRequest":{"required":["attributeModelUri","attributeSelections","attributesToQuery"],"type":"object","properties":{"attributeSelections":{"$ref":"#/components/schemas/Rule.Models.V1.ValidationAttributeSelection"},"attributeModelUri":{"type":"string","description":"The attribute model resource to validate."},"attributesToQuery":{"minItems":1,"type":"array","description":"The attributes to query for their remaining valid values. Must provide at least one. If you do not need this then please use the Attribute Resolver. You cannot query attributes that you have selected. Doing so will result in a bad request.","items":{"type":"string"}}},"description":"Request to validate a model."},"ModelValidationResponse":{"type":"object","properties":{"isValid":{"type":"boolean","description":"Whether the selections were valid with respect to the model."},"queriedAttributeRemainingOptions":{"type":"array","description":"The valid selectable values for the queried attributes. Null when the selections are invalid.","items":{"$ref":"#/components/schemas/QueriedAttributeRemainingOption"}}},"description":"The result of validating an attribute model with queried attributes."},"QueriedAttributeRemainingOption":{"type":"object","properties":{"key":{"type":"string","description":"The attribute key."},"type":{"type":"string","description":"The type of attribute, defining the shape of this attribute's values and how the values\ncan be specified.\n* numeric - resolves to a numeric value. Set of values are specified with a combination of numberLiterals and ranges.\n* string - resolves to a string. Set of values are specified with stringLiterals.\n","enum":["numeric","string"]},"values":{"type":"array","description":"The remaining valid selectable values.","items":{"$ref":"#/components/schemas/AttributeModelValue"}}},"description":"The remaining valid selectable values for a queried attribute."},"AttributeModelValue":{"required":["type"],"type":"object","properties":{"type":{"type":"string","description":"The type of specification, driving how this specification should be interpreted.","enum":["numberLiteral","range","stringLiteral"]},"stringLiteral":{"type":"string","description":"A single string value, used when type is 'stringLiteral'."},"numberLiteral":{"type":"string","description":"A single numeric value, used when type is 'numberLiteral'."},"range":{"$ref":"#/components/schemas/AttributeModelRange"}},"description":"Specifies value(s) for a constraint or attribute."},"AttributeModelRange":{"required":["minimum"],"type":"object","properties":{"minimum":{"type":"string","description":"The lower boundary of the numeric range, inclusive."},"maximum":{"type":"string","description":"The upper boundary of the numeric range, inclusive. If not provided, then maximum will be unbounded."},"increment":{"type":"string","description":"The increment between discrete numbers in the range. If not provided, then the range will be continuous."}},"description":"A range describing a set of numbers."},"BadRequestError":{"type":"object","properties":{"message":{"type":"string","description":"A summary of the error"}}},"RuleSetNotFoundError":{"type":"object","properties":{"message":{"type":"string","description":"A summary of the error."}},"description":"No rule set could be found for the provided reference ID."},"MalformedValidationRequestError":{"type":"object","properties":{"message":{"type":"string","description":"A summary of the error."},"details":{"type":"object","properties":{"validationErrors":{"type":"array","items":{"$ref":"#/components/schemas/InvalidInputError"}}}}},"description":"The request was malformed, as described by the validationErrors."},"InvalidInputError":{"required":["reason"],"type":"object","properties":{"key":{"type":"string","description":"The key of the invalid selection, assuming the selection was invalid."},"value":{"type":"string","description":"The invalid value, serialized to a string."},"reason":{"type":"string","description":"A human-readable description for why the input was invalid."}},"description":"An invalidity on the provided input selection."},"Rule.Models.V1.Attribute":{"required":["attributeKey","required","type"],"type":"object","properties":{"required":{"type":"boolean","description":"Attribute required status"},"derived":{"type":"boolean","description":"Gets or sets a value indicating whether this Rule.Models.V1.Attribute is derived."},"type":{"type":"string","description":"The type of attribute"},"class":{"type":"string","description":"The class of attribute. It is expected to be of Document, Order, Product, or Tenant."},"subclass":{"type":"string","description":"The subclass of the attribute"},"attributeKey":{"type":"string","description":"The name of the attribute"},"description":{"type":"string","description":"Gets or sets the description."},"defaultAttributeValue":{"type":"string","description":"The default value to use if no value is provided in the selection at validation time. This value must be within the AttributeValues"},"attributeValues":{"type":"array","description":"The list of values associated with an attributeKey","items":{"$ref":"#/components/schemas/Rule.Models.V1.DescriptiveAttributeValue"}},"defaultAttributeRange":{"type":"number","description":"The default value to use if no value is provided in the selection at validation time. This value must be within one of the AttributeRanges","format":"double"},"attributeRanges":{"type":"array","description":"The list of ranges associated with an attributeKey","items":{"$ref":"#/components/schemas/Rule.Models.V1.DescriptiveRange"}},"attributeValueTranslations":{"type":"array","description":"The attribute value translations","items":{"$ref":"#/components/schemas/Rule.Models.V1.AttributeValueTranslation"}},"containerDeclarations":{"type":"array","description":"Gets or sets the container declarations.","items":{"type":"string"}},"formula":{"type":"string","description":"Gets or sets the rules formula."},"includeOnOrder":{"type":"boolean","description":"Whether or not to include this attribute on the order"},"allowAdhocValues":{"type":"boolean","description":"Whether or not to allow ad-hoc values to be defined."}},"description":"The AttributeSelect Model"},"Rule.Models.V1.Rule":{"required":["name"],"type":"object","properties":{"name":{"type":"string","description":"The name of the rule"},"description":{"type":"string","description":"Gets or sets the description."},"predicates":{"type":"array","description":"The list of attribute rules as predicates","items":{"$ref":"#/components/schemas/Rule.Models.V1.AttributeRule"}},"results":{"type":"array","description":"The list of attribute rules as results","items":{"$ref":"#/components/schemas/Rule.Models.V1.AttributeRule"}}},"description":"The Rule Model"},"Rule.Models.V1.DataSheet":{"required":["dataRows","name"],"type":"object","properties":{"name":{"type":"string","description":"The name of the Data Sheet instance"},"dataRows":{"type":"array","description":"The collection of DataSheetRows that define the constraints","items":{"$ref":"#/components/schemas/Rule.Models.V1.DataSheetRow"}}},"description":"Defines a Data Sheet constraint for a Rule Set"},"Rule.Models.V1.DescriptiveAttributeValue":{"required":["value"],"type":"object","properties":{"description":{"type":"string","description":"Gets or sets the description."},"value":{"type":"string","description":"Gets or sets the value."},"unitOfMeasure":{"type":"string","description":"The unit of measure for the attribute."}},"description":"Attribute values, with descriptions."},"Rule.Models.V1.DescriptiveRange":{"required":["minimum"],"type":"object","properties":{"description":{"type":"string","description":"Gets or sets the description."},"minimum":{"type":"number","description":"The minimum value","format":"double"},"maximum":{"type":"number","description":"The maximum value. If omitted, the range is unbounded. If it equals minimum, the range consists of a single value","format":"double"},"increment":{"type":"number","description":"The increment. If omitted, the range is continuous (i.e. any value between minimum and maximum will be in the range)","format":"double"},"unitOfMeasure":{"type":"string","description":"The Attribute unit of measure."}},"description":"Ranges with descriptions"},"Rule.Models.V1.AttributeValueTranslation":{"required":["attributeSelections","attributeValue"],"type":"object","properties":{"attributeValue":{"$ref":"#/components/schemas/Rule.Models.V1.AttributeValue"},"attributeSelections":{"type":"array","description":"The selections for the given attribute value","items":{"$ref":"#/components/schemas/Rule.Models.V1.AttributeSelection"}}},"description":"The attribute value translation"},"Rule.Models.V1.AttributeRule":{"required":["attributeKey","operator"],"type":"object","properties":{"attributeKey":{"type":"string","description":"The name of the attribute"},"attributeValues":{"type":"array","description":"The list of values associated with an attributeKey","items":{"$ref":"#/components/schemas/Rule.Models.V1.AttributeValue"}},"attributeRanges":{"type":"array","description":"The list of ranges associated with an attributeKey","items":{"$ref":"#/components/schemas/Rule.Models.V1.Range"}},"formula":{"type":"string","description":"Gets or sets the formula."},"operator":{"type":"string","description":"The operator for the rule"},"negate":{"type":"boolean","description":"Attribute negation flag (default is false if this property is omitted)"}},"description":"The Attribute Rule Model"},"Rule.Models.V1.DataSheetRow":{"required":["terms"],"type":"object","properties":{"terms":{"type":"array","description":"The set of Data Sheet Terms that define the Data Sheet Row","items":{"$ref":"#/components/schemas/Rule.Models.V1.DataSheetTerm"}}},"description":"Defines one row for a Data Sheet constraint for a Rule Set"},"Rule.Models.V1.AttributeValue":{"required":["value"],"type":"object","properties":{"value":{"type":"string","description":"Gets or sets the value."},"unitOfMeasure":{"type":"string","description":"The unit of measure for the attribute."}},"description":"The attribute value."},"Rule.Models.V1.AttributeSelection":{"required":["attributeKey","attributeValue","class"],"type":"object","properties":{"class":{"type":"string","description":"The class of attribute. It is expected to be of Document, Order, Product, or Tenant."},"subclass":{"type":"string","description":"The subclass of the attribute"},"attributeKey":{"type":"string","description":"The name of the attribute"},"attributeValue":{"type":"string","description":"The value for the given attributeKey"}},"description":"The Attribute Model"},"Rule.Models.V1.Range":{"required":["minimum"],"type":"object","properties":{"minimum":{"type":"number","description":"The minimum value","format":"double"},"maximum":{"type":"number","description":"The maximum value. If omitted, the range is unbounded. If it equals minimum, the range consists of a single value","format":"double"},"increment":{"type":"number","description":"The increment. If omitted, the range is continuous (i.e. any value between minimum and maximum will be in the range)","format":"double"},"unitOfMeasure":{"type":"string","description":"The Attribute unit of measure."}},"description":"A range of numbers"},"Rule.Models.V1.DataSheetTerm":{"required":["attributeKey","operator"],"type":"object","properties":{"attributeKey":{"type":"string","description":"The name of the Attribute constrained by this term"},"operator":{"type":"string","description":"Defines how the Attribute's values are constrained by this term","enum":["In","NotIn","in","notIn"]},"attributeValues":{"type":"array","description":"The set of values the Attribute's value must be or must not be in","items":{"$ref":"#/components/schemas/Rule.Models.V1.AttributeValue"}},"attributeRanges":{"type":"array","description":"The set of ranges the Attribute's value must be or must not be in","items":{"$ref":"#/components/schemas/Rule.Models.V1.Range"}}},"description":"Defines one term for a Data Sheet Row in a Data Sheet constraint for a Rule Set"},"Rule.Models.V1.RuleSet":{"required":["whiteList"],"type":"object","properties":{"id":{"type":"string","description":"The ruleSet id","format":"uuid"},"tenantId":{"type":"string","description":"Gets or sets the tenant identifier."},"authoritative":{"type":"boolean","description":"True if and only if the tenant id + reference id matches a row in introduction.\r\nIf true this rule set will be validated if no tenant id is provided to the validation route."},"lastModified":{"type":"string","description":"The last modified date.","format":"date-time"},"referenceId":{"type":"string","description":"The referenceId"},"whiteList":{"type":"array","description":"The whitelist","items":{"$ref":"#/components/schemas/Rule.Models.V1.Attribute"}},"rules":{"type":"array","description":"The list of rules","items":{"$ref":"#/components/schemas/Rule.Models.V1.Rule"}},"dataSheets":{"type":"array","description":"The set of Data Sheet constraints","items":{"$ref":"#/components/schemas/Rule.Models.V1.DataSheet"}},"description":{"type":"string","description":"Gets or sets the description."}},"description":"The RuleSet Model"},"ProductValidationResponseAsRuleSetResponse":{"type":"object","properties":{"isValid":{"type":"boolean"},"isComplete":{"type":"boolean"},"violatedRuleNames":{"type":"array","items":{"type":"string"}},"violatedDataSheetNames":{"type":"array","items":{"type":"string"}},"violatedSelections":{"type":"array","items":{"$ref":"#/components/schemas/Rule.Models.Validation.Violation"}},"remainingOptions":{"type":"array","items":{"$ref":"#/components/schemas/Rule.Models.V1.Attribute"}},"finalSelections":{"type":"array","items":{"$ref":"#/components/schemas/Rule.Models.V1.FinalSelection"}}}},"CT.Products.Client.RulesExecutor.Models.ValidationResponse":{"type":"object","properties":{"isValid":{"type":"boolean"},"isComplete":{"type":"boolean"},"activeExclusions":{"type":"array","items":{"type":"string"}},"missingAttributes":{"type":"array","items":{"$ref":"#/components/schemas/Rule.Models.V1.Attribute"}},"violatedExclusions":{"type":"array","items":{"$ref":"#/components/schemas/Rule.Models.V1.Rule"}},"violatedRules":{"type":"array","items":{"$ref":"#/components/schemas/Rule.Models.V1.Rule"}},"violatedDataSheets":{"type":"array","items":{"$ref":"#/components/schemas/Rule.Models.V1.DataSheet"}},"violatedSelections":{"type":"array","items":{"$ref":"#/components/schemas/Rule.Models.Validation.Violation"}},"remainingOptions":{"type":"array","items":{"$ref":"#/components/schemas/Rule.Models.V1.Attribute"}},"finalSelections":{"type":"array","items":{"$ref":"#/components/schemas/Rule.Models.V1.FinalSelection"}},"exceptions":{"type":"array","items":{"type":"string"}}}},"Rule.Models.Validation.Violation":{"type":"object","properties":{"attributeKey":{"type":"string","description":"The attribute key in violation"},"message":{"type":"string","description":"A description of why the violation occurred."}},"description":"The structure for all violations within the rules engine"},"Rule.Models.V1.FinalSelection":{"required":["attributeKey","attributeValue","class"],"type":"object","properties":{"unitOfMeasure":{"type":"string","description":"The unit of measure for the selected value."},"class":{"type":"string","description":"The class of attribute. It is expected to be of Document, Order, Product, or Tenant."},"subclass":{"type":"string","description":"The subclass of the attribute"},"attributeKey":{"type":"string","description":"The name of the attribute"},"attributeValue":{"type":"string","description":"The value for the given attributeKey"}},"description":"A final selection."},"RuleSetFilter":{"required":["whiteList"],"type":"object","properties":{"whiteList":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/RuleSetAttributeFilter"}}}},"FilteredValidationRequest":{"required":["filter"],"type":"object","properties":{"filter":{"$ref":"#/components/schemas/RuleSetFilter"}}},"FilteredAttributeValue":{"required":["value"],"type":"object","properties":{"value":{"type":"string","description":"Gets or sets the value."},"unitOfMeasure":{"type":"string","description":"The unit of measure for the value."}},"description":"The attribute value."},"FilteredRange":{"required":["minimum"],"type":"object","properties":{"minimum":{"type":"number","description":"The minimum value","format":"double"},"maximum":{"type":"number","description":"The maximum value. If omitted, the range is unbounded. If it equals minimum, the range consists of a single value","format":"double"},"increment":{"type":"number","description":"The increment. If omitted, the range is continuous (i.e. any value between minimum and maximum will be in the range)","format":"double"},"unitOfMeasure":{"type":"string","description":"The unit of measure for the range."}},"description":"A range of numbers"},"RuleSetAttributeFilter":{"required":["attributeKey"],"type":"object","properties":{"attributeKey":{"type":"string","description":"The name of the attribute"},"attributeValues":{"type":"array","items":{"$ref":"#/components/schemas/FilteredAttributeValue"}},"attributeRanges":{"type":"array","items":{"$ref":"#/components/schemas/FilteredRange"}},"formula":{"type":"string"}}},"CT.Products.Client.RulesExecutor.Models.ValidationRequest":{"required":["ruleSet"],"type":"object","properties":{"attributeSelections":{"$ref":"#/components/schemas/Rule.Models.V1.ValidationAttributeSelection"},"ruleSet":{"$ref":"#/components/schemas/Rule.Models.V1.RuleSet"}}},"Rule.Models.V1.ValidationAttributeSelection":{"type":"object","description":"The attribute selection used for validation.","example":{"quantity":"25","Format":"A4"}}},"responses":{"RuleSetEmptyBody":{"description":"The rule set exists. Empty body return.","headers":{"Rule-Set-Last-Modified":{"description":"Last modified date for the rule set resolved against","schema":{"type":"string"}},"Rules-Engine-Version":{"description":"Version of the Rules Engine that the attributes are resolved against","schema":{"type":"string"}},"Isolated-Property-Assignments-Last-Modified":{"description":"Last modified date for the Isolated Property Assignments resolved against, if the rule set has them.","schema":{"type":"string"}}},"content":{}}},"securitySchemes":{"auth0AccessToken":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://cimpress.auth0.com/authorize","scopes":{}}}},"cimpressAccessToken":{"type":"oauth2","flows":{"implicit":{"authorizationUrl":"https://oauth.cimpress.io/authorize","scopes":{}}}}}}}