Skip to content

Add Redoc documentation #689

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

Merged
merged 1 commit into from
Dec 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ api_platform:
# Enable Swagger ui.
enable_swagger_ui: true

# Enable ReDoc.
enable_re_doc: true

# Enable the entrypoint.
enable_entrypoint: true

Expand Down
2 changes: 1 addition & 1 deletion core/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Here is the fully featured REST API you'll get in minutes:
* Hypermedia (JSON-LD and HAL)
* Machine-readable documentation of the API in the Hydra and [Swagger/Open API](swagger.md) formats,
guessed from PHPDoc, Serializer, Validator and Doctrine ORM metadata
* Nice human-readable documentation built with Swagger UI and including a sandbox
* Nice human-readable documentation built with Swagger UI (including a sandbox) and/or ReDoc
* [Pagination](pagination.md)
* A bunch of [filters](filters.md)
* [Ordering](default-order.md)
Expand Down
12 changes: 6 additions & 6 deletions core/swagger.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Swagger / Open API Support

API Platform natively support the [Open API](https://www.openapis.org/) (formerly Swagger) API documentation format.
It also integrates a customized version of [Swagger UI](https://swagger.io/swagger-ui/), a nice tool to display the
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
API documentation in a user friendly way.

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

// e.g. add a custom parameter
$docs['paths']['/foos']['get']['parameters'][] = $customDefinition;

// e.g. remove an existing parameter
$docs['paths']['/foos']['get']['parameters'] = array_values(array_filter($docs['paths']['/foos']['get']['parameters'], function ($param){
return $param['name'] !== 'bar';
}));

// Override title
$docs['info']['title'] = 'My Api Foo';

Expand Down Expand Up @@ -346,10 +346,10 @@ You can also dump your current Swagger documentation using the provided command:
$ docker-compose exec php bin/console api:swagger:export
# Swagger documentation in JSON format...

$ docker-compose exec php bin/console api:swagger:export --yaml
# Swagger documentation in YAML format...
$ docker-compose exec php bin/console api:swagger:export --yaml
# Swagger documentation in YAML format...

$ docker-compose exec php bin/console api:swagger:export --output=swagger_docs.json
$ docker-compose exec php bin/console api:swagger:export --output=swagger_docs.json
# Swagger documentation dumped directly into JSON file (add --yaml to change format)
```

Expand Down