Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't read swagger JSON from http://localhost/connect/swagger/default/json #2

Open
urfusion opened this issue Mar 1, 2017 · 8 comments

Comments

@urfusion
Copy link

urfusion commented Mar 1, 2017

exception 'yii\web\NotFoundHttpException' in D:\xampp\htdocs\connect\vendor\gbksoft\yii2-swagger\controllers\DefaultController.php:154 Stack trace: #0 [internal function]: gbksoft\modules\swagger\controllers\DefaultController->actionJson() #1 D:\xampp\htdocs\connect\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array) #2 D:\xampp\htdocs\connect\vendor\yiisoft\yii2\base\Controller.php(156): yii\base\InlineAction->runWithParams(Array) #3 D:\xampp\htdocs\connect\vendor\yiisoft\yii2\base\Module.php(523): yii\base\Controller->runAction('json', Array) #4 D:\xampp\htdocs\connect\vendor\yiisoft\yii2\web\Application.php(102): yii\base\Module->runAction('swagger/default...', Array) #5 D:\xampp\htdocs\connect\vendor\yiisoft\yii2\base\Application.php(380): yii\web\Application->handleRequest(Object(yii\web\Request)) #6 D:\xampp\htdocs\connect\index.php(12): yii\base\Application->run() #7 {main}

@azinkey
Copy link

azinkey commented Mar 2, 2017

i am also facing same issue

@littlefuntik
Copy link
Collaborator

You are must ckeck module configuration value swaggerPath, becouse module actionJson have logic for check this path readable. See action logic controllers/DefaultController.php:L154

@urfusion
Copy link
Author

urfusion commented Mar 6, 2017

I didn't have swagger.json in my whole project

@littlefuntik
Copy link
Collaborator

The file swagger.json must be present.
I want to draw your attention to event on beforeJson in https://github.com/gbksoft/yii2-swagger/blob/master/README.md

@urfusion
Copy link
Author

urfusion commented Mar 6, 2017

There is no file. I am using yii2 basic on win 7 with xampp.

I also tried that on ubuntu 16.04, AWS EC2 with Php 7. but same result :(

@littlefuntik
Copy link
Collaborator

littlefuntik commented Mar 9, 2017

There is no file.

This extension do not work without swagger.json file

@urfusion
Copy link
Author

urfusion commented Mar 9, 2017

and swagger file is not present in extension.

@littlefuntik
Copy link
Collaborator

and swagger file is not present in extension.

yes. See example: https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v2.0/json/petstore-simple.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants