|
nfx-serialization 0.3.0
Cross-platform C++ JSON serialization library with extensible trait capabilities
|
Represents a single JSON schema validation error. More...
#include <nfx/serialization/json/SchemaValidator.h>
Classes | |
| struct | ErrorEntry |
| Simple error entry structure for convenient ValidationError construction. More... | |
Public Member Functions | |
| ValidationError (const ErrorEntry &entry) | |
| Construct validation error from ErrorEntry struct. | |
| ValidationError (std::string path, std::string message, std::string constraint, std::string expectedValue={}, std::string actualValue={}) | |
| Construct validation error. | |
| ~ValidationError ()=default | |
| Destructor. | |
| const std::string & | path () const noexcept |
| Get the JSON path where validation failed. | |
| const std::string & | message () const noexcept |
| Get human-readable error message. | |
| const std::string & | constraint () const noexcept |
| Get the constraint type that failed. | |
| const std::string & | expectedValue () const noexcept |
| Get expected value or constraint. | |
| const std::string & | actualValue () const noexcept |
| Get actual value found in document. | |
| std::string | toString () const |
| Get formatted error string. | |
Represents a single JSON schema validation error.
Contains detailed information about validation failures including the failed constraint, document path, expected vs actual values, and human-readable error messages.
Definition at line 54 of file SchemaValidator.h.
|
explicit |
Construct validation error from ErrorEntry struct.
| entry | Error entry with all validation details |
| nfx::serialization::json::ValidationError::ValidationError | ( | std::string | path, |
| std::string | message, | ||
| std::string | constraint, | ||
| std::string | expectedValue = {}, | ||
| std::string | actualValue = {} ) |
Construct validation error.
| path | JSON path where validation failed |
| message | Human-readable error description |
| constraint | The schema constraint that failed (e.g., "type", "minLength") |
| expectedValue | Expected value or constraint (optional) |
| actualValue | Actual value found in document (optional) |

|
inlinenoexcept |
Get actual value found in document.
Definition at line 137 of file SchemaValidator.h.
|
inlinenoexcept |
Get the constraint type that failed.
Definition at line 125 of file SchemaValidator.h.

|
inlinenoexcept |
Get expected value or constraint.
Definition at line 131 of file SchemaValidator.h.

|
inlinenoexcept |
Get human-readable error message.
Definition at line 119 of file SchemaValidator.h.

|
inlinenoexcept |
Get the JSON path where validation failed.
Definition at line 113 of file SchemaValidator.h.

| std::string nfx::serialization::json::ValidationError::toString | ( | ) | const |
Get formatted error string.