diff --git a/gatsby-node.js b/gatsby-node.js index 0b460e52..345d51f1 100755 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -202,7 +202,9 @@ const createTypeDocPage = async (createPage, name, downloadUrl) => { // https://github.com/swagger-api/swagger-js const fetchSwaggerSpec = async (component) => { try { - const client = await Swagger(`http://localhost:5000/spec`) + const client = await Swagger( + `https://${component}.mainnet.oceanprotocol.com/spec` + ) return client.spec // The resolved spec // client.originalSpec // In case you need it diff --git a/src/templates/Swagger/Paths.jsx b/src/templates/Swagger/Paths.jsx index 0f1d311e..56e01daf 100644 --- a/src/templates/Swagger/Paths.jsx +++ b/src/templates/Swagger/Paths.jsx @@ -4,9 +4,7 @@ import slugify from 'slugify' import { cleanPathKey } from './utils' import styles from './Paths.module.scss' import stylesDoc from '../Doc.module.scss' -const ResponseExample = React.lazy(() => - import("./ResponseExample") -) +const ResponseExample = React.lazy(() => import('./ResponseExample')) const ParameterExample = ({ properties }) => ( // // HEADS UP! @@ -36,10 +34,10 @@ const ParameterExample = ({ properties }) => ( )} {(properties[key].type === 'integer' || properties[key].type === 'number') && ( - - {`${properties[key].example}`} - - )} + + {`${properties[key].example}`} + + )} {(properties[key].type === 'array' || properties[key].type === 'object') && JSON.stringify(properties[key].example, null, 2)} @@ -91,24 +89,26 @@ Parameters.propTypes = { } const Responses = ({ responses }) => { - const isSSR = typeof window === "undefined" + const isSSR = typeof window === 'undefined' - return (<> -
{key}
{responses[key].description}
- {key}
{responses[key].description}
+
- {typeof jsonExample === 'boolean' ? (
- {JSON.stringify(jsonExample)}
- ) : (
-
- )}
-
- {plainText}
-
+ {typeof jsonExample === 'boolean' ? (
+ {JSON.stringify(jsonExample)}
+ ) : (
+
+ )}
+
+ {plainText}
+