You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've configured my api with swagger openapi3.0, unfortunately, it is not showing try it out button for my API endpoints. am I missing any configuration in the swagger file? can anyone help me how to solve this error? I've already posted the same on stackoverflow for help. but some stupid people are closing it as a duplicate by not knowing whether the question is having accepted answer or not.
Note: I'm using swagger open API3.0
here is the configuration I've used:
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Reinvent-API",
"description": "Reusable and minimalistic API for Hyperledger-fabric Networks",
"contact": {
"name": "Dev",
"email": "dev@gmail.com",
"url": "https://dev.github.io/"
},
"license": {
"name": "MIT",
"url": "https://opensource.org/licenses/MIT"
}
},
"servers": [
{
"url": "http://localhost:3000/api"
}
],
"paths": {
"/invoke": {
"post": {
"tags": [
"API Explorer"
],
"description": "invoke chaincode function",
"operationId": "invoke",
"requestBody": {
"description": "body parameters should be passed as the order defined in chaincode function. First argument must be function name to call.",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/invoke"
}
}
}
},
"responses": {
"200": {
"description": "Chaincode Invoke Succesfull.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/invoke"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"invoke": {
"properties": {
"fcn": {
"type": "string"
},
"arg1": {
"type": "string"
},
"arg2": {
"type": "string"
}
}
}
}
}
}
Here is the express configuration I've used.
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json());
swaggerUi = require('swagger-ui-express')
swaggerDocument = require('./swagger.json');
app.use(bodyParser.urlencoded({ extended: true }));
var options = {
swaggerOptions: {
supportedSubmitMethods:["get", "post"]
}
};
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument, options));
Or maybe it should be posted to swagger-ui github as a bug?
The text was updated successfully, but these errors were encountered:
I can't see anything wrong with your OpenAPI document, and it behaves fine with the online editor.swagger.io and the swagger-ui instance at http://petstore.swagger.io.
If you still have problems with swagger-ui, you are right, this should be raised as an issue on that repo, not here (which is for the specification itself only).
I've configured my api with swagger openapi3.0, unfortunately, it is not showing try it out button for my API endpoints. am I missing any configuration in the swagger file? can anyone help me how to solve this error? I've already posted the same on stackoverflow for help. but some stupid people are closing it as a duplicate by not knowing whether the question is having accepted answer or not.
Note: I'm using swagger open API3.0
here is the configuration I've used:
Here is the express configuration I've used.
Or maybe it should be posted to swagger-ui github as a bug?
The text was updated successfully, but these errors were encountered: