Swagger - hide definition, BUT....
Hi, I am trying to hide definition/document (the one you select from top right dropdown), but make all endpoints available. Point is, to do "first filter" for curious users, then authorization. As you can see in attached filter I want to remove WHOLE group "admin" from the dropdown, but let Swagger make the page and also access it. Of course all endpoints will be standardly accessable. In points - what I do not want: Remove those endpoints from the page Remove the page itself (even if from address bar those endpoints will be still available e.g. from the Postman) Make those endpoints not accessible Optimally I would like to avoid run JS, after load. Thank you in forward, Jansame http method and same URL END POINT
I have two API which have same HTTP method (for e.g. post ) and same end point but contain is different (method name is different like : login , refresh password ) . I make swagger documentation but in swagger it display one API not second API I use "one of" method but I can not select second API schema from dropdown . I don't want to change HTTP method and URL end point.How to set Schemes default value to HTTPS
In the browser console I receive this when trying to identify my Swagger UI version: JSON.stringify(versions) '{"swaggerUI":{"version":"5.17.14","gitRevision":"g8aa52920","gitDirty":true,"buildTimestamp":"Tue, 28 May 2024 05:23:41 GMT"}}' Looking in the UI it looks like a 3.x version My question is as follows: In the Swagger UI there is a field named Schemes. This field has the values HTTP and HTTPS but always defaults to HTTP and we manually have to set it to HTTPS before starting to use the tool. How do I for the field Schemes permanently set the default value to be HTTPS? We have a load balancer between the computer clients and the web server. The load balancer has the certificate and perform https offloading. The communication between the load balancer and the web servers is done with http. Example how I want it to be can be seen at this web pagehttps://petstore.swagger.io Where you can see the field Schemes is set to HTTPS as default when accessing the page. I've searched this forum and other sources trying to find the answer to this question without any luck. Any idea is much appreciated.Recursive schemas and contributions to swagger-ui
Hello, I'm working on a project that uses a spec that is recursive, and due an old issue (from 2017 - see note 1), swagger-ui can't render it. It can easily reproduced (as in note 3) I would like to know: I'm the only one using recursive schemas? There is some kind of workaround? I would like to work on a fix to it. But a few days ago I wrote a PR (note 2) to fix another issue, and it seems to be ignored by the main contributors. So before write another PR, I would like to ask: how to not be ignored by the community? 1. https://github.com/swagger-api/swagger-ui/issues/3325 2. https://github.com/swagger-api/swagger-ui/pull/8400 3. Enter https://editor-next.swagger.io/ and paste this schema openapi: 3.0.3 info: {title: "recur", version: "1.0.0"} paths: /pet: put: responses: default: description: Successful operation content: application/json: schema: $ref: '#/components/schemas/Pet' components: schemas: Pet: type: object properties: name: {type: number} myself: {$ref: "#/components/schemas/Pet"}1.6KViews0likes2CommentsRegarding swagger is not working in nodejs as per the swagger document.
Hi there, I tried to setup swagger on nodejs as per the document par it is not working and present wrong data of swagger UI see the below attached screenshot. So just wanted to know how to setup swagger in nodejs so that all my apis display in one place. I tried lot of solutions on different different websites but same issue appeared. So kindly guide how to do that so that swagger is running properly. Reference site that I tried below: https://swagger.io/docs/open-source-tools/swagger-codegen/#:~:text=The%20Swagger%20Codegen%20is%20an,can%20be%20found%20in%20GitHub. https://levelup.gitconnected.com/how-to-add-swagger-ui-to-existing-node-js-and-express-js-project-2c8bad9364ce https://medium.com/bb-tutorials-and-thoughts/how-to-add-swagger-to-nodejs-rest-api-7a542cfdc5e1 https://plainenglish.io/blog/how-to-implement-and-use-swagger-in-nodejs-d0b95e765245 https://dev.to/kabartolo/how-to-document-an-express-api-with-swagger-ui-and-jsdoc-50do https://itnext.io/setting-up-swagger-in-a-node-js-application-d3c4d7aa56d4 https://github.com/Surnet/swagger-jsdoc/blob/master/README.md Looking forward to hearing from you. Thanks! Swagger.json: { "swagger": "2.0", "info": { "version": "1.0.0", "title": "My User Project CRUD", "description": "My User Project Application API", "license": { "name": "MIT", "url": "https://opensource.org/licenses/MIT" } }, "host": "localhost:3000", "basePath": "/", "tags": [ { "name": "Users", "description": "API for users in the system" } ], "schemes": ["http"], "consumes": ["application/json"], "produces": ["application/json"] } Server.js: import swaggerUi from 'swagger-ui-express'; import swaggerDocument from './swagger.json'; app.use( '/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument) ); app.listen(port, () => { console.log(`Server running at ${process.env.SERVER_URL}`); });3.1KViews0likes6Commentsswagger 3.0 request body is getting reset to default value while I collapse the API request.
swagger 3.0 request body is getting reset to default value when I collapse the API request. I want if any of the field in request body gets updated it should persist the value even after collapsing the API request. request body: { "id": "string", "seqno": "string" } modified request body: { "id": "1000", "seqno": "12" } Now If I collapse the API in swagger UI, I see the entered data lost and now request body is showing default value: { "id": "string", "seqno": "string" }How can we reference helm values in a static swagger file
i have tried components: securitySchemes: oauth: type: oauth2 description: This API uses OAuth 2 with the implicit grant flow. [More info](https://api.example.com/docs/auth) flows: authorizationCode: authorizationUrl: ${AUTHORIZATION_URL} tokenUrl: ${TOKEN_URL} scopes: {} and also components: securitySchemes: oauth: type: oauth2 description: This API uses OAuth 2 with the implicit grant flow. [More info](https://api.example.com/docs/auth) flows: authorizationCode: authorizationUrl: {{env "AUTHORIZATION_URL" } tokenUrl: {{ env "TOKEN_URL" }} scopes: {} I have container for swagger, both above doesnt seem to work any ideas would be helpful Thanks