Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Add dedicated swagger file to test endpoint error boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
Dom Harrington committed Aug 30, 2018
1 parent f6a00cc commit 5c46a0e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 17 deletions.
2 changes: 2 additions & 0 deletions example/src/Demo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class Demo extends React.Component {
{
this.state.status.length === 0 && (
<ApiExplorer
// // To test the top level error boundary, uncomment this
// docs={[null, null]}
docs={this.state.docs}
oasFiles={{
'api-setting': Object.assign(extensions.defaults, this.state.oas),
Expand Down
31 changes: 31 additions & 0 deletions example/swagger-files/endpoint-error-boundary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"openapi": "3.0.0",
"servers": [
{
"url": "http://httpbin.org"
}
],
"info": {
"version": "1.0.0",
"title": "Boolean without double description"
},
"paths": {
"/anything/error-boundary": {
"post": {
"summary": "Demo for error boundary if there is an error rendering the endpoint",
"description": "",
"parameters": [],
"responses": {},
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnknownSchema"
}
}
}
}
}
}
}
}
17 changes: 0 additions & 17 deletions example/swagger-files/types.json
Original file line number Diff line number Diff line change
Expand Up @@ -363,23 +363,6 @@
}
}
}
},
"/anything/error-boundary": {
"post": {
"summary": "Demo for error boundary if there is an error rendering the endpoint",
"description": "",
"parameters": [],
"responses": {},
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnknownSchema"
}
}
}
}
}
}
},
"x-explorer-enabled": true,
Expand Down

0 comments on commit 5c46a0e

Please sign in to comment.