xmlvalid/xmlvalid-symfony
Symfony bundle for xmlvalid that validates XML documents against XSD schemas directly from your services, commands and pipelines. Configure it once and get clear validation errors without writing boilerplate.
composer show xmlvalid/xmlvalid-php
v1.2.0 of this package requires xmlvalid/xmlvalid-php 1.2+. If Composer still resolves 1.1.x, force the dependency update before testing:
composer update xmlvalid/xmlvalid-php --with-dependencies
XmlvalidMockResponse test helper. The release is primarily about response shape parity: mock responses now include:
path on each error — where the business rule firedsha256 on the resultengine on the resultXmlvalidMockResponse so tests receive the same payload shape as the live API, then assert errors.*.path, sha256, and engine are present and readable through the SDK models.final class XmlValidationResult
{
public function __construct(
public bool $valid,
public array $errors, // each with path, message, etc.
public ?string $sha256,
public ?string $engine,
) {}
}
This keeps your app resilient if future SDK versions add more response metadata.path for diagnostics and user-facing messages. Since it identifies where a business rule fired, map it to your domain object/field when possible rather than showing raw paths to end users.sha256 and engine when validation results matter for audit, caching, or deduplication. A useful cache key is often sha256 + engine + validation profile, assuming the contract confirms sha256 represents the validated document content.XmlvalidMockResponse consistently for success and failure cases. Prefer partial assertions such as assertJsonPath('errors.0.path', ...) over full JSON snapshots, because response metadata is now richer and likely to evolve.xmlvalid/xmlvalid-php 1.1, where the models will not read the new fields even if a mock returns them.XmlvalidMockResponse may now answer with path, sha256, and engine, but older xmlvalid/xmlvalid-php models will ignore those fields. If your app sees missing values, check composer show xmlvalid/xmlvalid-php first.path as nullable/optional in defensive code. It is present on each error where a business rule fired, but global/document-level failures may not have a meaningful path depending on the API contract.engine as an enum unless the API contract guarantees the values. Log it, store it, and use it for traceability; avoid branching on exact strings without a documented set.sha256 is useful for audit and deduplication, but verify what content is hashed before relying on it for security-sensitive comparisons. Normalize XML consistently before hashing or caching.How can I help you explore Laravel packages today?