How to use swagger file locally? - swagger

Hi I have a swagger file written for my API and I could not test the paths of my API since I am getting: ERROR Server not found or an error occurred because my paths are all localhost, so how can i use swagger locally? thank you

I found a solution which is using the building from source way in swagger-editor

Assuming you are developing within Visual studio click the green play looking button to build & run your solution , a browser should now pop up. ignore whatever it comes up with and type localhost/swagger and it should provide you with the interface. Let me know what happens or if you require any assistance

Related

How to debug VSTS extension build summary tab without deploying to VSTS service?

I need to develop a fairly complex UI for VSTS build summary tab. I'm using VS Code as the code editor. Following url describes how to debug using Edge browser, however this approach require constantly packaging and deploying extension to VSTS making it time consuming.
https://www.visualstudio.com/en-us/docs/integrate/extensions/test/debug-in-browser
I tried to directly load the .html (summary tab) using View In Browser extension and following message displayed in browser console,
No handler found on any channel for message:
{"id":1,"methodName":"initialHandshake","instanceId":"VSS.HostControl","params":[{"notifyLoadSucceeded":true,"vssSDKVersion":2}],"jsonrpc":"2.0","handshakeToken":"4234q23rqfafaf23r"}
Is there any better way of debugging the application while developing?
You can develop locally. Since VSTS uses an iframe to show your extension's content, you can run a local server and reference that in the vss-extension.json manifest.
First, in the vss-extension.json, set the baseUri property to where you are running your project locally, such as https://localhost:8889. You need to be running it as https for VSTS to serve the content, as otherwise you will get a "Mixed Content" error and VSTS will refuse to display your extension's content.
Then, publish your extension and run it locally. Wha-la, you should have local development. There may be more trial and error needed, let me know if there's any steps that I'm missing.
If the link still works (you know how the Interent is), this starter project is a great start: https://github.com/Microsoft/vsts-extension-multivalue-control
No, you can’t debug the extension code without deploying extension to VSTS, the extension must be deployed to the VSTS before debug the code.
After initial deployment you may be able to use Fiddler to return your files directly from disk using FiddlerScript or the AutoResponder feature.

What are the options for swagger-editor to save json or yaml into remote backend?

I know that the Swagger-editor saves api documentation into the local browser cache ("Download Yaml/Json" and "Export Yaml/Json").
But what if I want to save it into a remote server then latter I can continue editing it from another browser.
Are there already known Backends for Swagger-editor which I can use?
Thanks in advance.
The swagger-node project has the editor built in and saves files in your filesystem.
Follow the steps in the README to install and run. When you make changes in the editor that you launch (your browser), they are autosaved, and you can see the change in the api directory. For example, if you change the { info: { title } } key, you'll see it autosave and then you can see the change in ./api/swagger/swagger.yaml.
There is an option to useBackendForStorage: true which does a HTTP put to a backend server.
Little late to the game, but maybe helps others:
There is a very simple backend here, written in go:
https://github.com/zgiber/sweb
It runs as a http server on your localhost, and opens the editor in a browser. Saves the swagger file as you type.

404 error when accessing Struts2 Web application

I had created a web application and committed the code in CVS. The web application is working good in my machine. When i tried to import the same code in another machine i am getting 404 error. I tried importing the code via ftp from my machine to another machine and also checking out the code from CVS. But still i get 404 error.
I also noticed that there is no error that had been captured in the console or in the application's log. Could someone help me in how to proceed further in identifying the issue. Please let me know if i need to post any further details regarding the issue.
I notice this issue to be in the Websphere server. I tried hosting the application in different machine and found that in few machine the same code is working good and some it is not. Is there any way to compare the server configuration?
In the WAS server 6.1 i added the below value in the web container and the application worked fine.
Steps:
In the server admin console, click on Application Server--> --> Web container--> custom properties.
Add the name as com.ibm.ws.webcontainer.invokefilterscompatibility and value as true.
Thank you all for the response.

local and remote zend server

I'm learning Zend framework 2 therefore i downloaded the zendstudio IDE included with the zend server as well. I made my little application which is working totally fine on my local zend server. I wanted to try zend PHP cloud as well so i deployed my application there with zend studio. This application didn't work perfectly there. Some of the content is working and the other parts did not load at all only white screen. I checked the server logs and this is what i found there:
Function Name Zend\Loader\StandardAutoloader::loadClass
Error Type E_COMPILE_ERROR
Source File /home/container_name/.apps/http/__default__/0/app/1.0.0/vendor/zendframework/zendframework/library/Zend/Loader/StandardAutoloader.php
Error String Can't use method return value in write context
I thought that there might be an error during file uploading so i re uploaded the files via an ftp client and the problem is still exists.
Any help is greatly appreciated
After a couple of hours of code trace i found the solution:
if($this->request->isPost()){
if(!empty($this->getRequest()->getPost('sg')) <--- this is the line where it dies
Remote wasn't liked the !empty() so i replaced it with !=''

Launch intellij via URL

Would it be possible to register some protocol
and then launch IntelliJ via an URL. I am
thinking of submitting the URL via Desktop.browse()
from within a JVM.
My idea is that the URL would consists of
a file name parameter and a line number parameter.
And IntelliJ would then open this file name and
scroll to the given line number. Here is an
example:
intellij:/mypath/myfile#99
Has this already been done?
Bye
P.S.:
java.awt.Desktop Class
http://docs.oracle.com/javase/6/docs/api/java/awt/Desktop.html
Check IDEA-65879 for existing workarounds or vote for the issue so that it's available out of the box in the future versions.
One of the suggested solutions is the Remote Call plug-in.
You could use IntelliJ Platform REST API.
Example to check: http://localhost:63342/api/about
Use Postman to send these requests.
For me, it works on IntelliJ Idea but unfortunately, on Android Studio it doesn't work.
Asked this question about it.

Resources