Hi,

I am new to Swagger and Dredd so pardon my newbie questions.

I had downloaded and built Swagger samples. I then ran into 2 separate 
issues where I hope someone had seen them before and can show me how to fix 
them.

1. I am using the sample from swagger-samples-master\java\java-jersey2 (on 
Windows). I am able to build and run each sample on web browser seeing the 
swagger.json from http://localhost:8002/api/swagger.json. When I try to run 
the Swagger-UI (http://localhost:8002) using Chrome, I can see the green 
Swagger toolbar at top. However, after entering the 
http://localhost:8002/api and special-keys and hit Explore button, nothing 
else is displaying. From Chrome Dev console, I can see errors "Uncaught 
ReferenceError: Handlebars is not defined" AND "Uncaught ReferenceError: 
SwaggerUi is not defined".

I cannot move forward from this point on.

2. So the Swagger-UI did not work for me but I was hoping that Dredd might. 
I took the swagger.json (from the above samples) and convert it to yml. I 
then run it through Dredd, e.g. dredd swagger.yml http://localhost:8002 
(for java-jersey2 sample.) Unfortunately, dredd has a bunch of errors:

error: Compilation error in file 'test.yml': Required URI parameter 'petId' 
has no example or default value. (pet > /api/pet/{petId} > Find pet by ID)
error: Compilation error in file 'test.yml': Required URI parameter 'petId' 
has no example or default value. (pet > /api/pet/{petId} > Find pet by ID)
error: Compilation error in file 'test.yml': Required URI parameter 'petId' 
has no example or default value. (pet > /api/pet/{petId} > Find pet by ID)
error: Compilation error in file 'test.yml': Required URI parameter 
'username' has no example or default value. (user > /api/user/login > Logs 
user into the system)
error: Compilation error in file 'test.yml': Required URI parameter 
'password' has no example or default value. (user > /api/user/login > Logs 
user into the system)
error: Compilation error in file 'test.yml': Required URI parameter 
'username' has no example or default value. (user > /api/user/login > Logs 
user into the system)
error: Compilation error in file 'test.yml': Required URI parameter 
'password' has no example or default value. (user > /api/user/login > Logs 
user into the system)
error: Compilation error in file 'test.yml': Required URI parameter 
'username' has no example or default value. (user > /api/user/{username} > 
Get user by user name)
error: Compilation error in file 'test.yml': Required URI parameter 
'username' has no example or default value. (user > /api/user/{username} > 
Get user by user name)
error: Compilation error in file 'test.yml': Required URI parameter 
'username' has no example or default value. (user > /api/user/{username} > 
Get user by user name)
error: Error when processing API description

For #2, I am not sure if converting swagger.json to yml is a good idea or 
not so some pointer here is very helpful.

So at this point, I am totally blocked using either swagger samples or 
dredd. Any help or pointer is much greatly appreciated.

Thanks,
Chi


-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to