-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from SmartBear-DevRel/feat/validation-error
Add validation-error type
- Loading branch information
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
layout: ../layouts/Problem.astro | ||
title: Validation Error | ||
description: This problem occurs when the request is deemed unprocessable. | ||
--- | ||
|
||
Your client issued a request that failed validation. Certain validation libraries return multi-errors and cannot be easily parsed into discreet types. This problem type, afforded the provider with the ability to surface all validation errors and negate the need for a trial and error workflow on your side. | ||
|
||
Please review your request to determine if you can remain within appropriate business rules. Consider validating your request against available metadata (e.g. schemas) prior to sending to the server. | ||
|
||
| Type URI | Title | Recommended HTTP Status Code | Reference | | ||
|----------|-------|------------------------------|-----------| | ||
|https://problems-registry.smartbear.com/validation-error|Validation Error|422|| | ||
|
||
> **Note** A problem is generally **not** meant to be used for end-user input validation, but for client developer convenience. | ||
**Example of a `validation-error` problem details:** | ||
|
||
```json | ||
{ | ||
"type": "https://problems-registry.smartbear.com/validation-error", | ||
"title": "Validation Error", | ||
"detail": "The request is not valid.", | ||
"status": 422, | ||
"code": "422-02", | ||
"errors": [ | ||
{ | ||
"detail": "Your request does not contain the required property {name}", | ||
"pointer": "#/name" | ||
}, | ||
{ | ||
"detail": "the path parameter does not conform to the expect format", | ||
"parameter": "petId" | ||
} | ||
] | ||
} | ||
``` |