Skip to content

Commit 37f5405

Browse files
authored
Merge pull request #689 from GregoireHebert/redoc
Add Redoc documentation
2 parents 67ced0e + 001a713 commit 37f5405

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

core/configuration.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ api_platform:
5151
# Enable Swagger ui.
5252
enable_swagger_ui: true
5353

54+
# Enable ReDoc.
55+
enable_re_doc: true
56+
5457
# Enable the entrypoint.
5558
enable_entrypoint: true
5659

core/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Here is the fully featured REST API you'll get in minutes:
2323
* Hypermedia (JSON-LD and HAL)
2424
* Machine-readable documentation of the API in the Hydra and [Swagger/Open API](swagger.md) formats,
2525
guessed from PHPDoc, Serializer, Validator and Doctrine ORM metadata
26-
* Nice human-readable documentation built with Swagger UI and including a sandbox
26+
* Nice human-readable documentation built with Swagger UI (including a sandbox) and/or ReDoc
2727
* [Pagination](pagination.md)
2828
* A bunch of [filters](filters.md)
2929
* [Ordering](default-order.md)

core/swagger.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Swagger / Open API Support
22

33
API Platform natively support the [Open API](https://www.openapis.org/) (formerly Swagger) API documentation format.
4-
It also integrates a customized version of [Swagger UI](https://swagger.io/swagger-ui/), a nice tool to display the
4+
It also integrates a customized version of [Swagger UI](https://swagger.io/swagger-ui/) and [ReDoc](https://rebilly.github.io/ReDoc/), some nice tools to display the
55
API documentation in a user friendly way.
66

77
![Screenshot](../distribution/images/swagger-ui-1.png)
@@ -54,12 +54,12 @@ final class SwaggerDecorator implements NormalizerInterface
5454

5555
// e.g. add a custom parameter
5656
$docs['paths']['/foos']['get']['parameters'][] = $customDefinition;
57-
57+
5858
// e.g. remove an existing parameter
5959
$docs['paths']['/foos']['get']['parameters'] = array_values(array_filter($docs['paths']['/foos']['get']['parameters'], function ($param){
6060
return $param['name'] !== 'bar';
6161
}));
62-
62+
6363
// Override title
6464
$docs['info']['title'] = 'My Api Foo';
6565

@@ -346,10 +346,10 @@ You can also dump your current Swagger documentation using the provided command:
346346
$ docker-compose exec php bin/console api:swagger:export
347347
# Swagger documentation in JSON format...
348348
349-
$ docker-compose exec php bin/console api:swagger:export --yaml
350-
# Swagger documentation in YAML format...
349+
$ docker-compose exec php bin/console api:swagger:export --yaml
350+
# Swagger documentation in YAML format...
351351
352-
$ docker-compose exec php bin/console api:swagger:export --output=swagger_docs.json
352+
$ docker-compose exec php bin/console api:swagger:export --output=swagger_docs.json
353353
# Swagger documentation dumped directly into JSON file (add --yaml to change format)
354354
```
355355

0 commit comments

Comments
 (0)