diff --git a/packages/api-explorer/__tests__/Doc.test.jsx b/packages/api-explorer/__tests__/Doc.test.jsx
index 0285bdde0..bb014ede9 100644
--- a/packages/api-explorer/__tests__/Doc.test.jsx
+++ b/packages/api-explorer/__tests__/Doc.test.jsx
@@ -308,21 +308,27 @@ test('should output with an error message if the endpoint fails to load', () =>
const brokenOas = {
paths: {
'/path': {
- 'post': {
+ post: {
requestBody: {
$ref: '#/components/schemas/UnknownSchema',
},
- }
- }
- }
+ },
+ },
+ },
};
const doc = mount(
+ doc={{
+ title: 'title',
+ slug: 'slug',
+ type: 'endpoint',
+ swagger: { path: '/path' },
+ api: { method: 'post' },
+ }}
+ />,
);
doc.setState({ showEndpoint: true });
diff --git a/packages/api-explorer/src/Doc.jsx b/packages/api-explorer/src/Doc.jsx
index 53ea43519..d8238ffa7 100644
--- a/packages/api-explorer/src/Doc.jsx
+++ b/packages/api-explorer/src/Doc.jsx
@@ -230,7 +230,7 @@ class Doc extends React.Component {
return (
- { this.props.flags.stripe ? this.themeStripe(doc) : this.themeMain(doc) }
+ {this.props.flags.stripe ? this.themeStripe(doc) : this.themeMain(doc)}
);
}
diff --git a/packages/api-explorer/src/EndpointErrorBoundary.jsx b/packages/api-explorer/src/EndpointErrorBoundary.jsx
index 07d300d95..0631d0a6a 100644
--- a/packages/api-explorer/src/EndpointErrorBoundary.jsx
+++ b/packages/api-explorer/src/EndpointErrorBoundary.jsx
@@ -19,7 +19,13 @@ class EndpointErrorBoundary extends React.Component {
return (
-
There was an error rendering this endpoint. Please contact support@readme.io with the following error:
+
+ There was an error rendering this endpoint. Please contact{' '}
+
+ support@readme.io
+ {' '}
+ with the following error:
+
{this.state.error && this.state.error.toString()}
{this.state.info.componentStack}
@@ -27,7 +33,7 @@ class EndpointErrorBoundary extends React.Component {
- )
+ );
}
return this.props.children;
}
@@ -35,6 +41,6 @@ class EndpointErrorBoundary extends React.Component {
EndpointErrorBoundary.propTypes = {
children: PropTypes.node.isRequired,
-}
+};
module.exports = EndpointErrorBoundary;