The blog on the website about Chinese is a lot of things, and many of them have wasted a lot of my time.
And then just get ready to bite. Read the English Documentation:
https://packagist.org/packages/zircote/swagger-php
To build the site, using the Yii2 2.0.12
Installing with composer
Composer require zircote/swagger-php
and then download Swagger-ui. This is primarily a client that does a swagger debug, and does not interact with the backend, mainly through a JSON to initialize the work
Https://github.com/swagger-api/swagger-ui
And then to the inside of the dist/index.html to modify the JSON file reference, I put this client into a separate domain name, and then write a method in Yii to generate a JSON
Define (' Api_host ', (yii_env = = = ' Dev ')? ' New.rprise.wd.com ': ' test.com ');
$b 2broot = Yii::getalias (' @rprise ');
$swagger = \swagger\scan ($b 2broot);
echo $swagger; exit;
Then point the dist/index.html file to this file route
Build a System
Const UI = Swaggeruibundle ({
URL: "HTTP://NEW.RPRISE.WD.COM/USER/GENSWG",//Modify this location
dom_id: ' #swagger-ui ',
Deeplinking:true,
In order to avoid misleading everyone, or not to say, and finally hope that we still see more official documents
HTTPS://GITHUB.COM/ZIRCOTE/SWAGGER-PHP/BLOB/HEAD/DOCS/GETTING-STARTED.MD//write the code's annotation specification here
Look at this when you see one Leng Leng
https://bfanger.nl/swagger-explained/#schemaObject
Building code generation at the outset may result in an error
Like what
@SWG/info not fount the kind is because did not write the comment, in short patient, believes the official website document, has the question message to discuss
Yii2 using zircote/swagger-php for swagger construction