I put javascript swagger generated client successfully into React project and everything is working fine. I am generating this client by online editor. Now I need to set timeouts.
Is it possible to change timeouts without changing the generated code? Or does exist any other javascript client generator which can I use to generate more robust JS client?
By making a PR, we've solved this. Now it is possible to set timeout by this way:
yourDefaultApiInstance.apiClient.timeout = timeoutInMillis;
Related
I am using a vertx server integrated with swagger. when I am using normal handler its working fine but when I am trying to use fiberhandler its not mapping to correct API in swagger page. Van someone please help in how we can render fiberhandler in vertx to swagger page?
FiberHandler is part of Vert.x Sync, which is now deprecated.
Vert.x Swagger itself (you didn't specify which project you are using, so I'll make some assumptions) wasn't updated in 3 years now.
Your only choice at the moment are:
To fork Vert.x Swagger and make changes around those lines
Stop using Vert.x Sync, as it's deprecated
I have created a new application using the ASPNetBoilerplate MVC 5x template. I have integrated Swagger UI according to the link:
https://aspnetboilerplate.com/Pages/Documents/Swagger-UI-Integration
Again using the MVC 5x version
When I run the app and use http://localhost:/swagger to access the API and try to run any of the GetAll methods, I get a 400 error.
I have modified the .cs file and created the .js files by cutting the code directly from the documentation and made the required changes.
What am I missing?
Thanks
I hope you are not navigating to http://localhost:/swagger because there's a typo error. Correct url is http://localhost/swagger
There's no official support for bearer token for Swagger UI Api calls. But you can checkout the link below. A developer achieves what you want
https://github.com/aspnetboilerplate/module-zero-core-template/pull/87
I have a .NET MVC application that includes a web service.
I have added Swashbuckle to the web service project and on my local machine everything works fine.
When I move the code to our TEST environment I begin to get 404 errors randomly for the various javascript and CSS libraries.
Sometimes the swagger/ui/index page itself throws a 404. Sometimes everything loads.
I've thought about downloading all of these files and placing them in my project for Swagger to use, but based on what I've read, and the way my local environment works, it doesn't seem like that's the way swashbuckle is designed to work, so I'm at a loss.
I have very limited access to the TEST environment so any server configuration will be an issue. My hope is that swagger.config file can be updated to make everything play nice.
I discovered that my TFS build server was NOT overwriting the previous build which led to differences between my load balanced servers and files that were not being updated with changes as I tried to get Swashbuckle to work.
There is an internal Liberty swagger-ui and it is working fine for me, but actually we need to make our own swagger layout, I mean putting our logo and our company name ... etc.
This is what we get when calling https://localhost:9443/ibm/api/docs with basic swagger-ui
But when we use the browser url and paste https://localhost:9443/ibm/api/docs we got the json content for our services
This is how it working with ibm liberty swagger-ui
And this how we need to show it to our clients
Currently there's no way to alter the "look & feel" of the built-in Liberty Swagger UI, but there is a Request For Enhancement that you can vote for: https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=87860
If you want to have your own Swagger UI totally independent of Liberty's UI, you can still pull from /ibm/api/docs like your first screenshot showed - the only thing you're missing is to setup CORS support on that Liberty instance, so that your custom Swagger UI is allowed to call it.
Here's the doc for setting up CORS in Liberty: https://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/twlp_webcontainer_cors_config.html?cp=SSEQTP_8.5.5%2F1-8-1-1-21-1
Main sample from the link:
<cors domain="/ibm/api/collective"
allowedOrigins="https://alice.com:8090"
allowedMethods="GET, DELETE, POST"
allowedHeaders="accept, MyRequestHeader1"
exposeHeaders="MyResponseHeader1"
allowCredentials="true"
maxAge="3600" />
I have successfully implemented MVC bundling for my MVC application. There is one problem with the run time which runs under HTTPS.
I am sure there is a problem because when I switch the debug field to false the user gets the warning message "This page contains secure and nonsecure items. Do you wish to proceed?
I know that I can turn this prompt off using the security setting in IE. I would like to know if there is something I can do to the application so that bundled scripts and styles come through the secure pipe.
If you use the Scripts.Render helper to include the bundle it will use the same HTTP scheme as the one used to request the main page. So if the main request was done over HTTPS then this helper will generate a <script> element using HTTPS. You could use the Net tab of FireBug to see which resources are served through HTTP and HTTPS and be able to isolate the problem.
Thank you for this suggestion. I figured out that the problem was coming from modernizr-1.7.js
The strange thing was that this problem only occurs when modernizr is bundled. I removed modernizr because we don't really need it.