forked from loafle/openapi-generator-original
Update default value for PHP server generators (slim, silex) (#272)
* update php slim samples * update php silex samples * update php silex default value
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# SwaggerServer
|
||||
# OpenAPIServer
|
||||
This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
|
||||
This [Symfony](https://symfony.com/) bundle is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||
This [Symfony](https://symfony.com/) bundle is automatically generated by the [OpenAPI Generator](https://github.com/openapitools/openapi-generator) project:
|
||||
|
||||
- API version: 1.0.0
|
||||
- Build package: org.openapitools.codegen.languages.PhpSymfonyServerCodegen
|
||||
@@ -26,7 +26,7 @@ To install the dependencies via [Composer](http://getcomposer.org/), add the fol
|
||||
Then run:
|
||||
|
||||
```
|
||||
composer require swagger/server-bundle:dev-master
|
||||
composer require openapi/server-bundle:dev-master
|
||||
```
|
||||
|
||||
to add the generated swagger bundle as a dependency.
|
||||
@@ -55,7 +55,7 @@ public function registerBundles()
|
||||
{
|
||||
$bundles = array(
|
||||
// ...
|
||||
new Swagger\Server\SwaggerServerBundle(),
|
||||
new OpenAPI\Server\OpenAPIServerBundle(),
|
||||
// ...
|
||||
);
|
||||
}
|
||||
@@ -65,8 +65,8 @@ Step 3: Register the routes:
|
||||
|
||||
```yaml
|
||||
# app/config/routing.yml
|
||||
swagger_server:
|
||||
resource: "@SwaggerServerBundle/Resources/config/routing.yml"
|
||||
open_apiserver:
|
||||
resource: "@OpenAPIServerBundle/Resources/config/routing.yml"
|
||||
```
|
||||
|
||||
Step 4: Implement the API calls:
|
||||
@@ -77,7 +77,7 @@ Step 4: Implement the API calls:
|
||||
|
||||
namespace Acme\MyBundle\Api;
|
||||
|
||||
use Swagger\Server\Api\PetApiInterface;
|
||||
use OpenAPI\Server\Api\PetApiInterface;
|
||||
|
||||
class PetApi implements PetApiInterface // An interface is autogenerated
|
||||
{
|
||||
@@ -111,7 +111,7 @@ services:
|
||||
acme.my_bundle.api.pet:
|
||||
class: Acme\MyBundle\Api\PetApi
|
||||
tags:
|
||||
- { name: "swagger_server.api", api: "pet" }
|
||||
- { name: "open_apiserver.api", api: "pet" }
|
||||
# ...
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user