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:
parent
76c1857046
commit
cc28c50c84
@ -1,19 +1,19 @@
|
|||||||
---
|
---
|
||||||
title: API References
|
title: API References
|
||||||
description:
|
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)
|
||||||
|
@ -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:
|
||||||
|
@ -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
|
||||||
|
@ -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,27 +219,25 @@ 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
|
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
|
// Swagger Pet Store example
|
||||||
const petStoreSlug = '/references/petstore/'
|
const petStoreSlug = '/references/petstore/'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user