How to get Swagger UI to work based on documentation guide? (even the example) - swagger

I am trying to use Swagger UI to document our node.js API, so I went to http://swagger.io/docs/, down to Swagger UI Documentation -> Usage, to find this
Now, this is not the only place that provides these instructions, there are dozens of blogs & tutorials saying the same thing, so that's exactly what I did.
Cloned the repo, went into /dist/ and ran the /dist/index.html and all I get is an empty page with an error:
I'm slowly going crazy now as I can't find anything about it and literally every place I looked just has the same, copied, instructions with nothing else provided (like what could go wrong? you just open a file...)
Any help or explanations are much appreciated!
P.S. for some reason opening the /public/index.html works (mentioned nowhere on the www)

I think this is bug in new version of swagger-UI. This is fresh release and they are still modifying and fixing bugs.
Look here: Swagger-ui cannot access JS scripts. This seems to be similar problem, maybe it will help you.

Related

Electron Remote Upgrade Issue

I have a working Electron app which I wrote about two years ago. I'm not an employee of a company, but just some guy that wrote an app that a few people use to make the world a better place. Anyway, I need to make some changes to the app but my computer crashed a while back so I downloaded my old code from Github onto my new computer and started to get to work. But immediately I found the app wouldn't work in the new 17.0.0 version of electron because the REMOTE module in Electron was deprecated and then removed in previous versions. I tried to follow the instructions here... https://www.npmjs.com/package/#electron/remote?activeTab=readme to replace REMOTE with the new #electron/remote module. I've had several problems, my most recent is:
JavaScript Error: Uncaught Exception: TypeError BrowserWindow is not a constuctor at app.createWindows (C:...\main.js:89:17).
I use the remote functionality (properties?) over 50 times in my app, including .dialogue, .getGlobal, .getCurrentWindow, and .BrowserWindow.getAllWindows
I'm not including my code here because I'm not really looking for a a coding solution (unless that's the easy/best/only thing I should do and you can give me a solution from the information I've written) but more general advice on what direction I should go to solve this problem. I'm a good programmer in a language that is not Electron, or JavaScript, or NodeJS! So, with the right instruction I can get by, but please be easy on me. (For example I get lost in the instructions for #electron/remote around the API Reference section.) Thanks for any help you can provide.
Mike
Some big changes have been made to Electron over the past couple of years, especially with the use of remote. I would hate to say it but it looks like you are in for a bit of work to get it operational again.
You will want to look at ipcMain, ipcRender and contextBridge.
The inclusion of webPreferences: {preload: ""} in your new BrowserWindow() method plus the use of the above Electron methods will place you in a good starting position for safe, quick, thread seperated code.
See Context Isolation and Inter-Process Communication for more info.
PS: If you need a quick bit of code to get you going / give you an idea then let me know.

How do I customize the banner/header image of Hyrax/Samvera?

I'm a web developer, trying to get my bearings with the Samvera-based application known as Hyrax. I'm using version 2.1.0.rc3. I have done some devops-type stuff with Hyrax so far, I have an app running on AWS and can deploy new code to that stack via Capistrano... but I'm tired of looking at the default header image... time to move in... however, I'm stuck. I've tried searching for terms like image-masthead in the application code, but so far, no luck. I have a suspicion this is a frequently asked question, so I'd accept as an answer just a link to a howto. But... in my searching for an answer I have not yet found such a document. So, I'm turning to Stack Overflow. Help?
In your local application, search the config/initializers/hyrax.rb file for the string config.banner_image and try uncommenting it (and altering the URL to a custom image) and restart your rails server.

Unsatisfied Link Error: Flink

I was trying to run a basic program in java by submitting to the job manager in Flink. I have a native library from open CV. When I try to submit the job I get "java.lang.UnsatisfiedLinkError: no opencv_java310 in java.library.path", however when I run it on eclipse by setting up the flink execution environment I get correct results.
I have followed some solutions from the apache flink support website:https://mail-archives.apache.org/mod_mbox/flink-user/201604.mbox/%3CCAO0MGUj_h==sw76-TWF6x8fnT_Vdc84mwu=YLejjn=bG-up+MQ#mail.gmail.com%3E and have modified my conf.yaml file accordingly (by pointing env.java.opts: -Djava.library.path="/path of Open CV library", but no luck,
Maybe my question is very basic , but still I am stuck, any help would be highly appreciated. Thanks :-)
I had a similar problem, often people references something like the "Tomcat" solution. Also, Flink with RocksDB writes the so to a tmp file, but this was also wrong.
If anyone else should pass this way- I wrote a short blog outlining the steps I took. OP's comment answer seems evident, but only after I also see the solution (when I was working on this, it was non-informative).
Shameless self promo:
https://rawkintrevo.org/2017/08/14/using-jnis-like-opencv-in-flink/

SharpDX - AssetNotFoundException

Sorry to raise this question again as I see it has been asked a few times however the solutions have not helped me.
The code I am trying to get to work is one of the sample examples, desktop version of SpriteBatchAndFont https://github.com/sharpdx/SharpDX-Samples/tree/master/Toolkit/WindowsDesktop/SpriteBatchAndFont
My particular problem is that font Arial16.xml and the balls.dds image raise the AssetNotFoundException.
From previous posts I have noted and checked the set up of a relative directory for loading contents - Content.RootDirectory = "Content"; and checked that the font and the image are in that named dir. Further I have noted and checked that the Build Action is set to ToolkitFont and ToolkitTexture for the font and texture respectively.
I have also read that the project may need to be in the %Documents% folder (do not understand why that would be, but tested it anyway) and also that the Contents folder may not have the required Windows permissions.
It may well be something simple that I am not aware of but I have been at this for a few days and have now run out of ideas and googling ability. I would be grateful for any help or pointers. Thanks.
I wasted hours triying to figure it out, as all official examples and tutorials on web doesn't mention that.
Changing directory to Content.RootDirectory = #"\Content"; finally worked for me.

How to configure JIRA_HOME?

How to configure JIRA_HOME? I'm getting an error:
Configured jira.home '/Users/codedroid/Downloads/atlassian-jira-5.1-standalone' must not be a parent directory of the webapp servlet path '/Users/codedroid/Downloads/atlassian-jira-5.1-standalone/atlassian-jira'
Changed it and now I get this:
Configured jira.home '/Users/codedroid/Downloads/atlassian-jira-5.1-standalone/atlassian-jira' must not be the same as the webapp servlet path '/Users/codedroid/Downloads/atlassian-jira-5.1-standalone/atlassian-jira'
Have a look in here, if you're still having troubles please write what did you set JIRA_HOME to be and where did you defined it, thanks.
EDIT
Yea, that documentation is more of 'how to' instead of 'what'. A better explanation of what the JIRA_HOME should be is writen in more details here.
Anyway, if you feel that the documentation are confusing or just bad, you could do everyone a favour and write it at the bottom of the page, under comments, so other could see it easily.
The JIRA documentation does NOT! make it clear even to a seasoned programmer that this JIRA_HOME directory is referring to a data directory and not the installation directory. If there are any JIRA folks out there please fix this outragious misunderstanding in your documentation. JAVA_HOME refers to you guessed it the installation location of java. Its called a 'convention' if you want to invent some other meaning please say so it your documentation and don't wast valuable developer time on installing your productivity tool. Think its not a problem? Google 'must not be the same as the webapp servlet path' and see what you get back. Thanks for wasting my afternoon, and no doubt the time of many others.
(warning) However, avoid locating the JIRA Home Directory inside the JIRA Installation Directory.
This appears in only documentation point and is not the first place people look as noted above
Just create a folder named JIRA, then set the environment variable JIRA_HOME as D:\JIRA, as well as the application properties file.
# jira-application.properties
jira.home = D:\\JIRA
Don't be confused with the JAVA_HOME, JIRA_HOME has absolutely nothing to do with the folder of your zip ball downloaded from official website.
JIRA_HOME is an empty folder where JIRA will create everything it needs in a RUNTIME.
It is NOT a folder where your unpacked JIRA distribution resides.
P.S. yes it is confusing still in 2021

Resources