Page 1 of 1

Handle with care: regex in machine readable spec versus ApiDoc

Posted: Wed Sep 24, 2025 12:17 pm
by Bernd Welter
I just crashed into this error message and from my perspective you should at least be aware of the underlying concept.
This is not a bug.

Code: Select all

{
  { "traceId": "...",
    "description": "The validation of the request failed. Details can be found in **causes**.",
    "errorCode": "GENERAL_VALIDATION_ERROR",
    "causes": [
      { "description": "The value of a string parameter does not satisfy the required pattern.",
        "errorCode": "GENERAL_PATTERN_VIOLATED",
        "parameter": "$.metadata.tags[1]",
        "details": { "pattern": "^[a-zA-Z0-9_-]{1,36}$" }
      }
    ],
    "details": {}
  }
Now here's what caused this error : my metadata tags have been set to this. Look at the second tag which is set to "pOrders:0".

Code: Select all

  "metadata": {
    "name": "Dummy Bernd Welter",
    "tags": [
      "locations-200",
      "pOrders:0",
      "dOrders-199",
      "pdOrders-",
      "vehicles-1"
    ]
  }
metadata.tags.png
The human readable API doc shows the necessity of the regex for the name. But not for the tags.
The human readable API doc shows the necessity of the regex for the name. But not for the tags.
In the machine readable spec the regex is documented for both name and tags:

Code: Select all

     "OptimizationRequestMetadata": {
        "description": "User-defined request metadata that does not influence the optimization but is returned in the result.",
        "type": "object",
        "properties": {
          "name": {
            "description": "The name of the optimization.",
            "maxLength": 100, "minLength": 1,
            "pattern": "^[a-zA-Z0-9_ -]{1,100}$", "type": "string"
          },
          "tags": {
            "description": "A list of tags of the optimization.",
            "maxItems": 5,
            "type": "array",
            "items": {
              "maxLength": 36, "minLength": 1,
              "pattern": "^[a-zA-Z0-9_-]{1,36}$", "type": "string"
            }}}}
Best regards,
Bernd