Skip to main content
For validation, style-lock, and policy errors, Kynva often returns a details[] array. Each entry can include:
  • fix_patch — a list of RFC 6902 JSON Patch ops to apply to your request body to make it pass.
  • violation_rect — a bounding box for visual issues, useful for highlighting in your UI.
These let you build “did-you-mean” flows and one-click fixes without writing rule-specific logic.

Example: applying a fix_patch

The server says color #FF00FF violates a BrandKit lock and suggests #7C3AED:
Apply it before retrying:

When not to auto-apply

  • Policy errors — applying the patch may produce something semantically different from what your user asked for. Always confirm.
  • More than one detail with conflicting patches — apply the first, retry, and let the server tell you about the next one.
  • High-trust contexts (e.g., billing copy) — patches are suggestions; surface them as “did you mean…?” in your UI rather than silently applying.

violation_rect

For visual errors (text overflow, image clipping), the server returns the offending rectangle so you can highlight it:
Coordinates are in the rendered output’s pixel space (top-left origin). Overlay this on top of the preview image to point users at the problem.