Skip to content

Commit

Permalink
Add validation-error type
Browse files Browse the repository at this point in the history
  • Loading branch information
frankkilcommins committed Oct 24, 2023
1 parent fa4a52e commit 0e0e6e6
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ import Card from '../components/Card.astro';
href="./invalid-request-parameter-value"
title="Invalid Request Parameter Value"
body="One or more of the query or path parameter values are invalid ⚠️"
/>
/>
<Card
href="./validation-error"
title="Validation Error"
body="The request is invalid and deemed unprocessable ⚠️"
/>
<Card
href="./business-rule-violation"
title="Business Rule Violation"
Expand Down
37 changes: 37 additions & 0 deletions src/pages/validation-error.md
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 an `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"
}
]
}
```

0 comments on commit 0e0e6e6

Please sign in to comment.