1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

add provider reference

This commit is contained in:
Matthias Kretschmann 2020-11-14 00:43:06 +01:00
parent 76c1857046
commit cc28c50c84
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 31 additions and 25 deletions

View File

@ -6,14 +6,14 @@ description:
This section has API reference docs (or links to external ones) for the following Ocean Protocol components and libraries: This section has API reference docs (or links to external ones) for the following Ocean Protocol components and libraries:
<repo name="ocean.js"></repo> <repo name="ocean.js"></repo>
<repo name="aquarius"></repo>
<repo name="provider"></repo>
<repo name="react"></repo> <repo name="react"></repo>
<repo name="ocean.py"></repo> <repo name="ocean.py"></repo>
<repo name="ocean-contracts"></repo> <repo name="ocean-contracts"></repo>
<repo name="aquarius"></repo>
<repo name="provider-py"></repo>
The API references for Aquarius and Provider-py are auto-generated from the Swagger specs (JSON files) of the live instances. On this site you can't execute the documented API calls yet. If you need that, you can run a component's local Swagger UI as outlined in the repository instructions on GitHub. The API references for Aquarius and Provider are auto-generated from the Swagger specs (JSON files) of the live instances. On this site you can't execute the documented API calls yet. If you need that, you can run a component's local Swagger UI as outlined in the repository instructions on GitHub.
Additionally, if you need API docs for a past version of Aquarius or Provider-py, check out their specs on SwaggerHub: Additionally, if you need API docs for a past version of Aquarius or Provider, check out their specs on SwaggerHub:
- [SwaggerHub: Aquarius](https://app.swaggerhub.com/apis/Ocean-Protocol/aquarius) - [SwaggerHub: Aquarius](https://app.swaggerhub.com/apis/Ocean-Protocol/aquarius)
- [SwaggerHub: Provider-py](https://app.swaggerhub.com/apis/Ocean-Protocol/provider-py) - [SwaggerHub: Provider](https://app.swaggerhub.com/apis/Ocean-Protocol/provider)

View File

@ -15,6 +15,9 @@
- name: API reference - name: API reference
url: /references/aquarius/ url: /references/aquarius/
- name: provider - name: provider
links:
- name: API reference
url: /references/provider/
- group: Ocean Market - group: Ocean Market
items: items:

View File

@ -13,6 +13,11 @@
- title: API Reference - title: API Reference
link: /references/aquarius/ link: /references/aquarius/
- group: provider
items:
- title: API Reference
link: /references/provider/
- group: react - group: react
items: items:
- title: API Reference - title: API Reference

View File

@ -198,10 +198,10 @@ const createTypeDocPage = async (createPage, name, downloadUrl) => {
// Create pages from swagger json files // Create pages from swagger json files
// //
// https://github.com/swagger-api/swagger-js // https://github.com/swagger-api/swagger-js
const fetchSwaggerSpec = async () => { const fetchSwaggerSpec = async (component) => {
try { try {
const client = await Swagger( const client = await Swagger(
`https://aquarius.mainnet.oceanprotocol.com/spec` `https://${component}.mainnet.oceanprotocol.com/spec`
) )
return client.spec // The resolved spec return client.spec // The resolved spec
@ -219,26 +219,24 @@ const fetchSwaggerSpec = async () => {
} }
const createSwaggerPages = async (createPage) => { const createSwaggerPages = async (createPage) => {
const swaggerComponents = ['aquarius'] const swaggerComponents = ['aquarius', 'provider']
const apiSwaggerTemplate = path.resolve('./src/templates/Swagger/index.jsx') const apiSwaggerTemplate = path.resolve('./src/templates/Swagger/index.jsx')
const getSlug = (name) => { const getSlug = (name) => `/references/${name}/`
const slug = `/references/${name}/`
return slug
}
const specAquarius = await fetchSwaggerSpec(swaggerComponents[0]) for (const component of swaggerComponents) {
const slugAquarius = getSlug(swaggerComponents[0]) const slug = getSlug(component)
createPage({ createPage({
path: slugAquarius, path: slug,
component: apiSwaggerTemplate, component: apiSwaggerTemplate,
context: { context: {
slug: slugAquarius, slug,
name: swaggerComponents[0], name: component,
api: specAquarius api: await fetchSwaggerSpec(component)
} }
}) })
}
// Swagger Pet Store example // Swagger Pet Store example
const petStoreSlug = '/references/petstore/' const petStoreSlug = '/references/petstore/'