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

@ -1,19 +1,19 @@
---
title: API References
description:
description:
---
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="aquarius"></repo>
<repo name="provider"></repo>
<repo name="react"></repo>
<repo name="ocean.py"></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.
Additionally, if you need API docs for a past version of Aquarius or Provider-py, check out their specs on SwaggerHub:
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, check out their specs on SwaggerHub:
- [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
url: /references/aquarius/
- name: provider
links:
- name: API reference
url: /references/provider/
- group: Ocean Market
items:

View File

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

View File

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