Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

API Explorer shows Petstore instead of custom API #43

Closed
dancju opened this issue Jun 22, 2018 · 3 comments
Closed

API Explorer shows Petstore instead of custom API #43

dancju opened this issue Jun 22, 2018 · 3 comments

Comments

@dancju
Copy link

dancju commented Jun 22, 2018

I configured the router according to document.

const router = new Router({
  apiDoc: path.join(__dirname, "api"),
  apiExplorerVisible: true
});
router.mount(middleware, path.join(__dirname, "controllers"));

All the APIs (http://localhost:8080/api/...) works fine.

The problem is, the API Explorer shows Petstore instead of my API.

deepinscreenshot_select-area_20180623022713

@dancju
Copy link
Author

dancju commented Jun 22, 2018

It works when I change the https://petstore.swagger.io/v2/swagger.json into api.json in that <input>.
But I guess api.json should be a default value.

@amazing-gao
Copy link
Collaborator

I'm sorry for this bug because the swagger-ui-dist is updated.

I try to replace the http://petstore.swagger.io/v2/swagger.json with api-explorer-config.json.

https://github.com/BiteBit/koa-oai-router/blob/575486e40a0ed1eaf7af22035105934c4e5ae5c7/src/swagger.js#L18-L20

index.html in swagger-ui-dist is updated to https://petstore.swagger.io/v2/swagger.json.
So the replacement is failed.

I will fix it right now.

amazing-gao added a commit that referenced this issue Jun 23, 2018
amazing-gao added a commit that referenced this issue Jun 23, 2018
fix(Api-Explorer): Fix issue #43
@amazing-gao
Copy link
Collaborator

Fixed, please update to 2.0.2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants