Validation and Verification

Validation and Verification#

Validation helps distinguish malformed requests from AAS model content that can be parsed but violates model constraints. Successfully validating a payload does not store it or guarantee that a later write will succeed: resource conflicts and endpoint-specific requirements are checked by the write operation.

Verification During Writes#

The shared server.strictVerification setting controls semantic verification on request-body paths that use the shared model verifier:

Mode

Behavior

off

Skip semantic verification. Parsing and endpoint-specific checks still apply.

permissive (configuration default)

Log semantic violations as warnings and continue processing.

strict

Reject semantic violations.

For a deployment that should reject invalid model content, merge this into its configuration and restart the service:

server:
  strictVerification: strict
  verificationEndpointAvailable: true

The equivalent variables are SERVER_STRICTVERIFICATION=strict and SERVER_VERIFICATIONENDPOINTAVAILABLE=true. See General Configuration for loading and precedence. Neither off nor permissive makes malformed JSON acceptable.

Check a Payload Before Writing It#

Except for the standalone DPP API, the BaSyx Go HTTP services can expose POST {contextPath}/verify when server.verificationEndpointAvailable is enabled. The DPP API does not register this endpoint. This shared endpoint verifies AAS model content. It is not a Registry descriptor-validation endpoint. It accepts JSON, XML, and AASX payloads. Supported model content includes AAS Environments and individual AAS model objects accepted by the parser.

Verification payloads use general.uploadMaxSizeBytes, which defaults to 128 MiB. A request that exceeds the applicable payload limit is rejected with 413 Request Entity Too Large.

Save this as verify-submodel.json:

{
  "modelType": "Submodel",
  "id": "urn:example:submodel:verification",
  "idShort": "VerificationExample"
}

Using the AAS Repository at port 8084:

curl -i -X POST http://localhost:8084/verify -H 'Content-Type: application/json' --data-binary '@verify-submodel.json'

Add the service context path if configured. Expect 200 OK, valid: true, and an empty messages array. The response also identifies the format and counts the contained AAS, Submodels, and Concept Descriptions.

Change idShort to 1Invalid and submit again. A parsed payload with semantic violations returns 200 OK with valid: false and diagnostic messages. Inspect valid; HTTP success alone does not mean the model passed verification. This explicit verification reports violations independently of the write-verification mode.

On a write route using semantic verification, the same invalid idShort is rejected in strict mode, logged in permissive mode, and not checked by the semantic verifier in off mode. Other write checks may still reject the request in any mode.