diff --git a/README.md b/README.md index cb66f48..f04bb22 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,24 @@ Generate the Open API spec ``` php artisan jsonapi:openapi:generate v1 ``` -Note that a seeded DB is required! The seeded data will be used to generate Samples. +Note that a seeded DB is required! The seeded data will be used to generate Samples. + +It's possible to add descriptions to your endpoints by implementing the DescribesEndpoints interface. The added method +receives the generated route name as a parameter. This can be used to generate descriptions for all your schema +endpoints. +``` php +class Post extends Schema implements DescribesEndpoints +{ + public function describeEndpoint(string $endpoint) { + if ($endpoint === 'v1.posts.index') { + return 'Description for index method'; + } + + return 'Default description'; + } +} +``` ## Generating Documentation A quick way to preview your documentation is to use [Speccy](https://speccy.io/). @@ -77,4 +93,9 @@ Ensure you have installed Speccy globally and then you can use the following com speccy serve storage/app/v1_openapi.yaml ``` +## Credits +- [Glenn Jacobs](https://github.com/glennjacobs) +- [Johannes Kees](https://github.com/byte-it) +- [Björn Brala](https://github.com/bbrala) +- [Rien van Velzen](https://github.com/Rockheep) diff --git a/composer.json b/composer.json index 4a3a165..6144c7a 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "byteit/openapi-spec-generator", + "name": "swisnl/openapi-spec-generator", "description": "Creates Open API spec for a Laravel JSON:API", "authors": [ { @@ -11,6 +11,17 @@ "name": "Johannes Kees", "homepage": "https://github.com/byte-it", "email": "johannes@lets-byte.it" + }, + { + "name": "Björn Brala", + "email": "bjorn@swis.nl", + "homepage": "https://github.com/bbrala" + }, + { + "name": "Rien van Velzen", + "email": "rvanvelzen@swis.nl", + "homepage": "https://github.com/Rockheep", + "role": "Developer" } ], "license": "Apache-2.0",