Allow to generate Body Parameters documentation from a json file.
Example:
/**
* Store user
*
* @bodyParamsFile requests/users.store.json
*
* @responseFile responses/users.store.json
*/
I would like to share my workflow.
I have helpers createJsonRequestFile() and createJsonResponseFile() that will write my json files in storage/requests and storage/responses folders.
Example:
public function test_users_store()
{
$response = $this->postJson(route('users.store'), $data = []);
$response
->createJsonRequestFile()
->createJsonResponseFile()
->assertCreated();
}
Then I run phpunit and apidoc:generate to generate my api docs:
phpunit && php artisan apidoc:generate
As you can see I create my json data from unit tests and currently we have @responseFile for responses that's why I would also like to suggest feature like @bodyParamsFile for body params.
Also, maybe we can also do this for @queryParamsFile and @urlParamsFile.
Allow to generate Body Parameters documentation from a json file. Example:
I would like to share my workflow.
I have helpers
createJsonRequestFile()
andcreateJsonResponseFile()
that will write my json files instorage/requests
andstorage/responses
folders. Example:As you can see I create my json data from unit tests and currently we have
@responseFile
for responses that's why I would also like to suggest feature like@bodyParamsFile
for body params.Also, maybe we can also do this for
@queryParamsFile
and@urlParamsFile
.