---
title: "TestSuggestionRule"
url: "https://us-prod.jeffyongtaotang.com/apis/konnect-service-catalog-1/versions/cdbef9b7-686c-4189-bbc8-55c727a972e8/schemas/TestSuggestionRule"
---

> Full API specification: https://us-prod.jeffyongtaotang.com/apis/konnect-service-catalog-1/versions/cdbef9b7-686c-4189-bbc8-55c727a972e8.md

# TestSuggestionRule

Contains evaluation results of a suggestion rule configuration against an integration record.

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: Konnect Service Catalog
  version: 1.3.0
servers:
  - url: https://us.api.konghq.com/v1
    description: United-States Production region
  - url: https://eu.api.konghq.com/v1
    description: Europe Production region
  - url: https://au.api.konghq.com/v1
    description: Australia Production region
  - url: https://me.api.konghq.com/v1
    description: Middle-East Production region
  - url: https://in.api.konghq.com/v1
    description: India Production region
  - url: https://sg.api.konghq.com/v1
    description: Singapore Production region
components:
  schemas:
    SuggestedRuleActionEvaluated:
      oneOf:
        - $ref: "#/components/schemas/ArchiveActionPayload"
        - $ref: "#/components/schemas/IgnoreActionPayload"
        - $ref: "#/components/schemas/MapActionPayload"
        - $ref: "#/components/schemas/CreateActionEvaluated"
    SuggestionRuleErrorDetail:
      type: object
      required:
        - type
        - field
        - expression
        - message
      properties:
        type:
          type: string
          description: >
            The type of error that occured when evaluating suggestion rule
            configuration against given integration record.
              - `error`: represents a generic error.
              - `timeout`: timeout occured when evaluating jq expression
              - `invalid-expression`: jq expression could not be evaluated due to syntax error(s).
              - `result-not-boolean`: jq expression was not evaluated to a boolean
              - `result-not-string`: jq expression was not evaluated to a string
              - `unexpected-result`: jq expression was not evaluated to a result that could not be determined
              - `InvalidLabelKeyInputType`: Indicates the label key is of an invalid type (i.e. number or symbol)
              - `InvalidEmptyLabelKey`: Indicates the label key is empty
              - `InvalidLabelKeyFormat`: Indicates that the format of the label key is invalid, ex: "-bad-format-"
              - `LabelKeyHasReservedPrefix`: Indicates that the label key starts with a Kong-reserved key prefix, ex: "kong-test-key"
              - `MaxLabelKeyCharsExceeded`: Indicates that a label key exceeds the maximum number of allowed characters
              - `InvalidLabelValueInputType`: Indicates the label value is of an invalid type (i.e. number or symbol)
              - `InvalidEmptyLabelValue`: Indicates that the label value is empty
              - `InvalidLabelValueFormat`: Indicates that the format of the label value is invalid, ex: "-bad-format-"
              - `MaxLabelValueCharsExceeded`: Indicates that a label value exceeds the maximum number of allowed characters
              - `InvalidLabelsInputType`: Indicates that a collection of labels is of an invalid type (i.e. array instead of key-value object)
              - `MaxLabelsPerEntityExceeded`: Indicates that a collection of labels exceeds the maximum number of labels allowed for a given entity
              - `ConflictingKeys`: Indicates that labels keys are not unique
              - `InvalidName`: Indicates that the name is invalid
              - `InvalidDisplayName`: Indicates that the display name is invalid
              - `InvalidDescription`: Indicates that the description is invalid
              - `InvalidLabels`: Indicates that the labels are invalid
              - `InvalidMetadata`: Indicates that the metadata is invalid
        field:
          type: string
          description: The field from the payload given which is responsible for this error.
        expression:
          type: string
          description: Represents the resolved or unresolved JQ expression which failed
            validation
        message:
          type: string
          description: Details of the error which occured when evaluating suggestion rule
            configuration against given integration record.
    ArchiveActionPayload:
      title: ArchiveActionPayload
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - archive
    IgnoreActionPayload:
      title: IgnoreAction
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - ignore
    MapActionPayload:
      title: MapAction
      description: >
        Must specify **at least one** of the following properties when
        `action_type` is `map`:

        - `id`

        - `name`
      type: object
      additionalProperties: false
      required:
        - type
        - data
      properties:
        type:
          type: string
          enum:
            - map
        data:
          type: object
          additionalProperties: false
          required:
            - service
            - resource
          properties:
            service:
              oneOf:
                - $ref: "#/components/schemas/MapByName"
                - $ref: "#/components/schemas/MapById"
            resource:
              type: object
              additionalProperties: false
              required:
                - labels
              properties:
                labels:
                  $ref: "#/components/schemas/LabelsTemplate"
    CreateActionEvaluated:
      title: CreateActionEvaluated
      type: object
      required:
        - type
        - data
      properties:
        type:
          type: string
          enum:
            - create
        data:
          type: object
          additionalProperties: false
          required:
            - service
            - resource
          properties:
            service:
              $ref: "#/components/schemas/CatalogServiceSuggestion"
            resource:
              type: object
              additionalProperties: false
              required:
                - labels
              properties:
                labels:
                  $ref: "#/components/schemas/LabelsTemplate"
    MapByName:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
          description: >
            Exact match on service name based on suggestion rule scope.

            Supports JQ expression syntax on discovered entity's
            `integration_record` property.
          example: "{{ .gateway_service.name }}-{{ .runtime_group.labels.env }}"
    MapById:
      type: object
      additionalProperties: false
      required:
        - id
      properties:
        id:
          type: string
          description: >
            Exact match on service identifier based on suggestion rule scope.

            Supports JQ expression syntax on discovered entity's
            `integration_record` property.
          example: 1ace6cb5-75ca-4488-a05d-9260628a37a8
    LabelsTemplate:
      title: LabelsTemplate
      type: object
      example:
        env: test
      description: >
        Labels to facilitate grouping and tagged search.

        Resolved keys must be of length 1-63 characters, and cannot start with
        ''kong'', ''konnect'', ''mesh'', ''kic'', or ''_''.'

        Label key and value supports JQ expression syntax on discovered entity's
        `integration_record` property.
      additionalProperties:
        type: string
        minLength: 1
    CatalogServiceSuggestion:
      type: object
      additionalProperties: false
      required:
        - name
        - display_name
      properties:
        name:
          type: string
          description: >
            The machine name of the Service that uniquely identifies it within
            the catalog.
          example: user-svc
        display_name:
          type: string
          description: The display name of the Service.
          example: User Service
        description:
          type: string
          description: Optionally provide a description of the Service.
        labels:
          $ref: "#/components/schemas/LabelsSuggestion"
        metadata:
          $ref: "#/components/schemas/CustomFieldsSuggestion"
    LabelsSuggestion:
      title: LabelsTemplate
      type: object
      example:
        env: test
      description: >
        Labels to facilitate grouping and tagged search.

        Resolved keys must be of length 1-63 characters, and cannot start with
        ''kong'', ''konnect'', ''mesh'', ''kic'', or ''_''.'

        Label key and value supports JQ expression syntax on discovered entity's
        `integration_record` property.
      additionalProperties:
        type: string
    CustomFieldsSuggestion:
      type: object
      description: >
        Map of customizable, catalog-defined fields providing information about
        a service.
      additionalProperties:
        anyOf:
          - $ref: "#/components/schemas/TextCustomField"
          - $ref: "#/components/schemas/NumericCustomField"
          - $ref: "#/components/schemas/BooleanCustomField"
          - $ref: "#/components/schemas/UrlCustomFieldSuggestion"
      example:
        owner: John Appleseed
        dashboard:
          name: On-Call Dashboard
          link: https://my-dashboard-svc.io/dashboards/1
    TextCustomField:
      type: string
      nullable: true
    NumericCustomField:
      type: number
      nullable: true
    BooleanCustomField:
      type: boolean
      nullable: true
    UrlCustomFieldSuggestion:
      additionalProperties:
        type: string
    TestSuggestionRule:
      title: TestSuggestionRule
      description: Contains evaluation results of a suggestion rule configuration
        against an integration record.
      type: object
      additionalProperties: false
      required:
        - evaluation
        - errors
      properties:
        evaluation:
          description: Evaluation result of suggesetion rule configuration against given
            integration record.
          type: object
          additionalProperties: false
          required:
            - matched
            - action
            - service_id
          properties:
            matched:
              description: Represents if the suggestion rule configuration matches the given
                integration record.
              type: boolean
            service_id:
              description: The identifier of a service the suggesiton rule configuration
                matches with the given integration record.
              type: string
              format: uuid
              nullable: true
              example: 7f9fd312-a987-4628-b4c5-bb4f4fddd5f7
            action:
              $ref: "#/components/schemas/SuggestedRuleActionEvaluated"
        errors:
          description: List of errors that occured when evaluating suggestion rule
            configuration against given integration record.
          type: array
          items:
            $ref: "#/components/schemas/SuggestionRuleErrorDetail"
```
