Skip to content

Commit

Permalink
Merge pull request #3 from swisnl/update-files-for-packagist-release
Browse files Browse the repository at this point in the history
Update files for packagist release
  • Loading branch information
Rocksheep authored Feb 24, 2022
2 parents 59ab11d + 09f83f7 commit 005137b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
Expand All @@ -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)
13 changes: 12 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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": [
{
Expand All @@ -11,6 +11,17 @@
"name": "Johannes Kees",
"homepage": "https://github.com/byte-it",
"email": "[email protected]"
},
{
"name": "Björn Brala",
"email": "[email protected]",
"homepage": "https://github.com/bbrala"
},
{
"name": "Rien van Velzen",
"email": "[email protected]",
"homepage": "https://github.com/Rockheep",
"role": "Developer"
}
],
"license": "Apache-2.0",
Expand Down

0 comments on commit 005137b

Please sign in to comment.