Comments (7)
The hardcoded "vendor/autoload.php" is used when swagger-php installed as a standalone project. (and composer install
is run from the swagger-php directory)
When swagger-php is installed as a require
in another project the relative path "../../../autoload.php" is used.
https://github.com/zircote/swagger-php/blob/master/bin/swagger#L31
What error are you getting?
from swagger-php.
Having setup the composer.json to use the CakePHP "Vendor" directory...
In terminal I run the following command from the app folder inside a CakePHP project:
php ./Vendor/zircote/swagger-php/swagger.phar -p ./Controller -o ./webroot -f -i ./webroot/index.php &> ./webroot/api-docs/swagger-log.html
The error I get is:
You must set up the project dependencies, run the following commands: wget http://getcomposer.org/composer.phar php composer.phar install
If I change my composer.json file to use the default "vendor" directory, I get no such error, and the api-docs are correctly generated.
from swagger-php.
I've got the error too, a temporary workaround is to use the bin/swagger
instead of the phar.
php ./Vendor/zircote/swagger-php/bin/swagger -p ./Controller -o ./webroot -f -i ./webroot/index.php &> ./webroot/api-docs/swagger-log.html
from swagger-php.
@bfanger have you tried to use swagger-php with the AuthComponent enabled? My app/Controller/AppController.php begins like this:
<?php
App::uses( 'Controller', 'Controller' );
class AppController extends Controller {
// Add the debugkit tool bar
public $components = array(
'DebugKit.Toolbar',
'Session',
'Cookie',
'RequestHandler',
'Auth'
);
...
When I run swagger-php I see no output in the webroot/api-docs/swagger-log.html page as used in the above command, but when I comment out the AuthComponent - 'Auth', and run the exact same command, I get the "./webroot/api-docs.json created" as output in the swagger-log.html page.
(For any readers, I am outputting the content of swagger-php to a .html page in my webroot as it includes some CakePHP generated HTML, and it's easier to read this in a browser, rather than decipher inline CSS, and JavaScript in a terminal window)
from swagger-php.
Probably fixed by #68 in the 0.6 branch , which can be installed with composer:
"require": {
"zircote/swagger-php": "0.6.*@dev"
}
The -i webroot/index.php
won't be needed anymore.
from swagger-php.
I'll definitely give this a go during the week, but for now I can say that with master-dev
, I've found that with CakePHP removing 'Auth' from public $components array(); and moving it to the beforeFilter of the AppController with an App::import('Component','Auth'); also works.
I was waiting for static analysis - can't wait to check this out!
from swagger-php.
swagger.phar bug fixed in 6e3dc13 (0.6 branch)
from swagger-php.
Related Issues (20)
- The latest tag and release differ : 4.9.4 vs 4.10.0 ? HOT 1
- Unable to group HOT 9
- [Feature]: Append "tags" list via Operation attribute HOT 3
- Parameters in laravel seem a bit too troublesome HOT 4
- Improve processor reference
- Possible BC Break in 4.10.1 HOT 4
- Validation fails with repeated tags since v4.10.1 HOT 3
- Global unified configuration suggestions
- Filtering not done as expected HOT 4
- How to set deepObject properties type HOT 1
- removeAnnotation performance HOT 1
- Fatal error "Nesting level too deep - recursive dependency?" HOT 2
- Tags within api definition are not unique HOT 2
- No output on CLI HOT 1
- How to work with discriminator?
- Schema generation fails inside JsonContent HOT 2
- Schema generator add illegal request key under requestBody HOT 5
- Operation security is invalid
- Default OpenAPI Version from RootContext overwrites OpenAPI Version from OpenApi Property HOT 4
- Duplicate tags will not be filtered out HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swagger-php.