From af1440a5b5bfa1f562c616329ff4187060683b57 Mon Sep 17 00:00:00 2001 From: shalvah Date: Tue, 16 Oct 2018 09:49:54 +0100 Subject: [PATCH 1/2] Document fractal dependency (closes #374) --- README.md | 7 +++++++ composer.json | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9856a834..1c1e94c3 100644 --- a/README.md +++ b/README.md @@ -194,6 +194,7 @@ public function createPost() They will be included in the generated documentation text and example requests. **Result:** + ![](body_params.png) ### Indicating auth status @@ -260,6 +261,12 @@ public function showUser(int $id) ``` For the first route above, this package will generate a set of two users then pass it through the transformer. For the last two, it will generate a single user and then pass it through the transformer. +> Note: for transformer support, you need to install the league/fractal package + +```bash +composer require league/fractal +``` + #### Gnerating responses automatically If you don't specify an example response using any of the above means, this package will attempt to get a sample response by making a request to the route (a "response call"). A few things to note about response calls: - They are done within a database transaction and changes are rolled back afterwards. diff --git a/composer.json b/composer.json index b779797d..a8c9c1ee 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,12 @@ "orchestra/testbench": "3.5.* || 3.6.* || 3.7.*", "phpunit/phpunit": "^6.0.0 || ^7.4.0", "dingo/api": "2.0.0-alpha1", - "mockery/mockery": "^1.2.0" + "mockery/mockery": "^1.2.0", + "league/fractal": "^0.17.0" }, + "suggest": { + "league/fractal": "Required for transformers support" + } "autoload": { "psr-4": { "Mpociot\\ApiDoc\\": "src/" From abe32c48ed4150ff6e723f7ebb254cc612f44ab0 Mon Sep 17 00:00:00 2001 From: shalvah Date: Tue, 16 Oct 2018 09:57:27 +0100 Subject: [PATCH 2/2] Document fractal dependency (closes #374) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a8c9c1ee..79af8ea0 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ }, "suggest": { "league/fractal": "Required for transformers support" - } + }, "autoload": { "psr-4": { "Mpociot\\ApiDoc\\": "src/"