eclipse-che / che

Kubernetes based Cloud Development Environments for Enterprise Teams
http://eclipse.org/che
Eclipse Public License 2.0
6.98k stars 1.19k forks source link

Unable to see Swagger documentation for WS Agent REST APIs #6309

Closed BarryDrez closed 7 years ago

BarryDrez commented 7 years ago

When I enter the URL in my browser: http://192.168.99.100:8080/swagger/?URL=http://192.168.99.100:32811/api/docs/swagger.json

where 32811 is the port of my WS Agent

I only see Swagger documentation for WS Master REST APIs (e.g., agent, factory, preferences, profile...). I even see documentation for my own REST API that is in WS Master.

Reproduction Steps:

OS and version:
Windows 7 using Oracle VirtualBox

I followed the instructions here: https://www.eclipse.org/che/docs/assemblies/sdk-rest-apis/

I would like to see Swagger REST API documentation for my APIs that run in the WS Agent. Also, I'd like to see them for the /Project REST API and other Che REST APIs that run in WS Agent.

I am running a custom assembly with Che 5.17.

ghost commented 7 years ago

image

I am on Ubuntu though.

Or, there's another way - http://172.17.0.1:8080/swagger/?url=http://172.17.0.1:32774/api/docs/swagger.json

In my case, its' ?url not ?URL

BarryDrez commented 7 years ago

What version is this? Also, I notice you have the Error (bottom right).

ghost commented 7 years ago

@BarryDrez nightlty tag. And disregard the error.

I wonder if this is some sort of boot2docker issue.

BarryDrez commented 7 years ago

I just tried it on a Ubuntu Linux machine, and I get the same error.

ghost commented 7 years ago

Tried 5.17.0 tag. Cannot reproduce. Are you certain you use the right port? Have you tried mydifying port in the main Swagger page?

BarryDrez commented 7 years ago

I am using the wsagent port

ghost commented 7 years ago

@BarryDrez can you share a screenshot with browser address bar visible?

BarryDrez commented 7 years ago

image

ghost commented 7 years ago

@BarryDrez I mean with swagger page

BarryDrez commented 7 years ago

image

BarryDrez commented 7 years ago

Is this the correct way?

ghost commented 7 years ago

@BarryDrez yes.

Quick question:

  1. You are on Ubuntu, right? Why do you use IP that you use? Why not localhost?
BarryDrez commented 7 years ago

Right. That is the URL that the console displays when I start Che. I tried it with localhost, and I get the same error. image

ghost commented 7 years ago

@BarryDrez i think I got it. You have created your assembly using achetypes. And those, use stripped version of ws-agent.

Please, take a look at https://github.com/eclipse/che/blob/master/assembly/assembly-wsagent-war/src/main/java/org/eclipse/che/wsagent/server/SwaggerServletModule.java

BarryDrez commented 7 years ago

Do I need to add this class to my assembly?

ghost commented 7 years ago

Yes, please take a look at how it's done in the default assembly.

BarryDrez commented 7 years ago

Yes. It works now. Thanks