Features

Validate constraint

Validates a constraint definition. Checks whether the context field exists and whether the applied configuration is valid. Additional properties are not allowed on data objects that you send to this endpoint.

post/api/admin/constraints/validate

Request body

contextNamestring required

The name of the context field that this constraint should apply to.

operator'NOT_IN' | 'IN' | 'STR_ENDS_WITH' | 'STR_STARTS_WITH' | 'STR_CONTAINS' | 'NUM_EQ' | 'NUM_GT' | 'NUM_GTE' | 'NUM_LT' | 'NUM_LTE' | 'DATE_AFTER' | 'DATE_BEFORE' | 'SEMVER_EQ' | 'SEMVER_GT' | 'SEMVER_LT' | 'SEMVER_GTE' | 'SEMVER_LTE' | 'REGEX' required

The operator to use when evaluating this constraint. For more information about the various operators, refer to the strategy constraint operator documentation.

caseInsensitiveboolean

Whether the operator should be case sensitive or not. Defaults to false (being case sensitive).

invertedboolean

Whether the result should be negated or not. If true, will turn a true result into a false result and vice versa.

valuesstring[]

The context values that should be used for constraint evaluation. Use this property instead of value for properties that accept multiple values.

valuestring

The context value that should be used for constraint evaluation. Use this property instead of values for properties that only accept single values.

Example request

{
  "contextName": "appName",
  "operator": "IN",
  "values": [
    "my-app",
    "my-other-app"
  ],
  "value": "my-app"
}

Response

The constraint is valid

Changes

Changed in 2 of the 7 revisions of this API.13

  • b2c3116e633e12See the full diff
    • the request property's minLength was increased from 0 to 1

      request-property-min-length-increased

    • added the new SEMVER_GTE enum value to the request property

      request-property-enum-value-added

    • added the new SEMVER_LTE enum value to the request property

      request-property-enum-value-added

    • added the new REGEX enum value to the request property

      request-property-enum-value-added

    This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog