Skip to content
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

feat(namespace): change namespace #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
},
"autoload": {
"psr-4": {
"Vyuldashev\\LaravelOpenApi\\": "src/"
"NovaEdge\\LaravelOpenApi\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Vyuldashev\\LaravelOpenApi\\Tests\\": "tests/",
"NovaEdge\\LaravelOpenApi\\Tests\\": "tests/",
"Examples\\Petstore\\": "examples/petstore/"
}
},
Expand All @@ -47,7 +47,7 @@
"extra": {
"laravel": {
"providers": [
"Vyuldashev\\LaravelOpenApi\\OpenApiServiceProvider"
"NovaEdge\\LaravelOpenApi\\OpenApiServiceProvider"
]
}
},
Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ The service provider will automatically get registered. Or you may manually add
```bash
'providers' => [
// ...
Vyuldashev\LaravelOpenApi\OpenApiServiceProvider::class,
NovaEdge\LaravelOpenApi\OpenApiServiceProvider::class,
];
```

You can publish the config file with:

```bash
php artisan vendor:publish --provider="Vyuldashev\LaravelOpenApi\OpenApiServiceProvider" --tag="openapi-config"
php artisan vendor:publish --provider="NovaEdge\LaravelOpenApi\OpenApiServiceProvider" --tag="openapi-config"
```

## Additional information
Expand Down
4 changes: 2 additions & 2 deletions docs/middlewares.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ Middlewares are an optional bit of logic to transform the given data at various

### Path

To add a path middleware create a class that implements `\Vyuldashev\LaravelOpenApi\Contracts\PathMiddleware` then register it by referencing it in the `openapi.collections.default.middlewares.paths` config array like `MyPathMiddleware::class`
To add a path middleware create a class that implements `\NovaEdge\LaravelOpenApi\Contracts\PathMiddleware` then register it by referencing it in the `openapi.collections.default.middlewares.paths` config array like `MyPathMiddleware::class`

Available lifecycle points are:
- `before` - after collecting all `RouteInformation` but before processing them.
- `after` - after the `PathItem` has been built.

### Component

To add a path middleware create a class that implements `\Vyuldashev\LaravelOpenApi\Contracts\ComponentMiddleware` then register it by referencing it in the `openapi.collections.default.middlewares.components` config array like `MyComponentMiddleware::class`
To add a path middleware create a class that implements `\NovaEdge\LaravelOpenApi\Contracts\ComponentMiddleware` then register it by referencing it in the `openapi.collections.default.middlewares.components` config array like `MyComponentMiddleware::class`

Available lifecycle points are:
- `after` - after the `Components` has been built.
6 changes: 3 additions & 3 deletions docs/paths/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In order to add route, you need to add `PathItem` attribute to controller class
This attribute will indicate that route which has `UserController@store` definition should be included in `paths`.

```php
use Vyuldashev\LaravelOpenApi\Attributes as OpenApi;
use NovaEdge\LaravelOpenApi\Attributes as OpenApi;

#[OpenApi\PathItem]
class UserController extends Controller
Expand Down Expand Up @@ -74,7 +74,7 @@ To use tags, first set them up in `config/openapi.php`:
Then add them using in the `Operation` attribute on your controller:

```php
use Vyuldashev\LaravelOpenApi\Attributes as OpenApi;
use NovaEdge\LaravelOpenApi\Attributes as OpenApi;

class UserController extends Controller
{
Expand All @@ -100,7 +100,7 @@ When a controller method accepts multiple methods, by default only the first is
To override which verb or method should be used on a particular operation, add the `method` parameter the `Operation` attribute on your controller:

```php
use Vyuldashev\LaravelOpenApi\Attributes as OpenApi;
use NovaEdge\LaravelOpenApi\Attributes as OpenApi;

class UserController extends Controller
{
Expand Down
18 changes: 9 additions & 9 deletions docs/paths/parameters.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Parameters

In order to add path or query parameters to route you need to create `Parameters` object factory.
In order to add path or query parameters to route you need to create `Parameters` object factory.

You may generate a new one using Artisan command:

Expand Down Expand Up @@ -35,16 +35,16 @@ class ListUsersParameters extends ParametersFactory
Finally, add `Parameters` attribute below `Operation` attribute:

```php
use Vyuldashev\LaravelOpenApi\Attributes as OpenApi;
use NovaEdge\LaravelOpenApi\Attributes as OpenApi;

class UserController extends Controller
class UserController extends Controller
{
/**
* List users.
*/
#[OpenApi\Operation]
#[OpenApi\Parameters(factory: ListUsersParameters::class)]
public function index()
public function index()
{
//
}
Expand Down Expand Up @@ -77,19 +77,19 @@ The following definition will be generated:
```

## Route Parameters
Let's assume we have route `Route::get('/users/{user}', 'UserController@show')`.

Let's assume we have route `Route::get('/users/{user}', 'UserController@show')`.

There is no need to add `Parameters` attribute as route parameters are automatically added to parameters definition:

```php
use Vyuldashev\LaravelOpenApi\Attributes as OpenApi;
use NovaEdge\LaravelOpenApi\Attributes as OpenApi;

class UserController extends Controller
class UserController extends Controller
{
/**
* Show user.
*
*
* @param User $user User ID
*/
#[OpenApi\Operation]
Expand Down
4 changes: 2 additions & 2 deletions docs/paths/request-bodies.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Generate a request body with this command:
php artisan openapi:make-requestbody StoreUser
```

You can refer to a schema by implementing `use Vyuldashev\LaravelOpenApi\Contracts\Reusable` on the schema and adding it to the request body like so:
You can refer to a schema by implementing `use NovaEdge\LaravelOpenApi\Contracts\Reusable` on the schema and adding it to the request body like so:

```php
class UserCreateRequestBody extends RequestBodyFactory
Expand All @@ -25,7 +25,7 @@ class UserCreateRequestBody extends RequestBodyFactory
Use a request body in your controller like this:

```php
use Vyuldashev\LaravelOpenApi\Attributes as OpenApi;
use NovaEdge\LaravelOpenApi\Attributes as OpenApi;

class UserController extends Controller
{
Expand Down
10 changes: 5 additions & 5 deletions docs/paths/responses.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ListUsersResponse extends ResponseFactory
Finally, add `Response` attribute with factory name to your route:

```php
use Vyuldashev\LaravelOpenApi\Attributes as OpenApi;
use NovaEdge\LaravelOpenApi\Attributes as OpenApi;

class UserController extends Controller
{
Expand All @@ -39,11 +39,11 @@ class UserController extends Controller

## Reusable responses

Responses can be reusable. Adding `Vyuldashev\LaravelOpenApi\Contracts\Reusable` will indicate that it should be added to `components/responses` section and reference will be used instead of response definition.
Responses can be reusable. Adding `NovaEdge\LaravelOpenApi\Contracts\Reusable` will indicate that it should be added to `components/responses` section and reference will be used instead of response definition.
This can be handy for validation errors object:

```php
use Vyuldashev\LaravelOpenApi\Contracts\Reusable;
use NovaEdge\LaravelOpenApi\Contracts\Reusable;

class ErrorValidationResponse extends ResponseFactory implements Reusable
{
Expand All @@ -70,7 +70,7 @@ class ErrorValidationResponse extends ResponseFactory implements Reusable
And in controller's method:

```php
use Vyuldashev\LaravelOpenApi\Attributes as OpenApi;
use NovaEdge\LaravelOpenApi\Attributes as OpenApi;

class UserController extends Controller
{
Expand All @@ -95,7 +95,7 @@ Even if the schema defines a status code, you **must** supply the status code in
Example:

```php
use Vyuldashev\LaravelOpenApi\Attributes as OpenApi;
use NovaEdge\LaravelOpenApi\Attributes as OpenApi;

class UserController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion docs/schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ If you would like to generate a schema from model, you may use the `--model` or
php artisan openapi:make-schema User -m User
```

To use a schema in a response, use and implement `Vyuldashev\LaravelOpenApi\Contracts\Reusable` in your schema, and do something like this in your response:
To use a schema in a response, use and implement `NovaEdge\LaravelOpenApi\Contracts\Reusable` in your schema, and do something like this in your response:

```php
use App\OpenApi\Schemas\UserSchema;
Expand Down
2 changes: 1 addition & 1 deletion docs/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ After you generate a security scheme, it will be declared in the `securityScheme
## Operation level example

```php
use Vyuldashev\LaravelOpenApi\Attributes as OpenApi;
use NovaEdge\LaravelOpenApi\Attributes as OpenApi;

#[OpenApi\PathItem]
class UserController extends Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use GoldSpecDigital\ObjectOrientedOAS\Objects\Parameter;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use Vyuldashev\LaravelOpenApi\Factories\ParametersFactory;
use NovaEdge\LaravelOpenApi\Factories\ParametersFactory;

class ListPetsParameters extends ParametersFactory
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use GoldSpecDigital\ObjectOrientedOAS\Objects\MediaType;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Response;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use Vyuldashev\LaravelOpenApi\Contracts\Reusable;
use Vyuldashev\LaravelOpenApi\Factories\ResponseFactory;
use NovaEdge\LaravelOpenApi\Contracts\Reusable;
use NovaEdge\LaravelOpenApi\Factories\ResponseFactory;

class ErrorValidationResponse extends ResponseFactory implements Reusable
{
Expand Down
4 changes: 2 additions & 2 deletions examples/petstore/OpenApi/Schemas/PetSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use GoldSpecDigital\ObjectOrientedOAS\Contracts\SchemaContract;
use GoldSpecDigital\ObjectOrientedOAS\Exceptions\InvalidArgumentException;
use GoldSpecDigital\ObjectOrientedOAS\Objects\Schema;
use Vyuldashev\LaravelOpenApi\Contracts\Reusable;
use Vyuldashev\LaravelOpenApi\Factories\SchemaFactory;
use NovaEdge\LaravelOpenApi\Contracts\Reusable;
use NovaEdge\LaravelOpenApi\Factories\SchemaFactory;

class PetSchema extends SchemaFactory implements Reusable
{
Expand Down
2 changes: 1 addition & 1 deletion examples/petstore/PetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Examples\Petstore\OpenApi\Parameters\ListPetsParameters;
use Examples\Petstore\OpenApi\Responses\ErrorValidationResponse;
use Vyuldashev\LaravelOpenApi\Attributes as OpenApi;
use NovaEdge\LaravelOpenApi\Attributes as OpenApi;

#[OpenApi\PathItem]
class PetController
Expand Down
2 changes: 1 addition & 1 deletion routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Route;
use Vyuldashev\LaravelOpenApi\Http\OpenApiController;
use NovaEdge\LaravelOpenApi\Http\OpenApiController;

Route::group(['as' => 'openapi.'], function () {
foreach (config('openapi.collections', []) as $name => $config) {
Expand Down
4 changes: 2 additions & 2 deletions src/Attributes/Callback.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Vyuldashev\LaravelOpenApi\Attributes;
namespace NovaEdge\LaravelOpenApi\Attributes;

use Attribute;
use InvalidArgumentException;
use Vyuldashev\LaravelOpenApi\Factories\CallbackFactory;
use NovaEdge\LaravelOpenApi\Factories\CallbackFactory;

#[Attribute]
class Callback
Expand Down
2 changes: 1 addition & 1 deletion src/Attributes/Collection.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Vyuldashev\LaravelOpenApi\Attributes;
namespace NovaEdge\LaravelOpenApi\Attributes;

use Attribute;

Expand Down
4 changes: 2 additions & 2 deletions src/Attributes/Extension.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Vyuldashev\LaravelOpenApi\Attributes;
namespace NovaEdge\LaravelOpenApi\Attributes;

use Attribute;
use InvalidArgumentException;
use Vyuldashev\LaravelOpenApi\Factories\ExtensionFactory;
use NovaEdge\LaravelOpenApi\Factories\ExtensionFactory;

#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_METHOD)]
class Extension
Expand Down
6 changes: 3 additions & 3 deletions src/Attributes/Operation.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Vyuldashev\LaravelOpenApi\Attributes;
namespace NovaEdge\LaravelOpenApi\Attributes;

use Attribute;
use InvalidArgumentException;
use Vyuldashev\LaravelOpenApi\Factories\SecuritySchemeFactory;
use NovaEdge\LaravelOpenApi\Factories\SecuritySchemeFactory;

#[Attribute(Attribute::TARGET_METHOD)]
class Operation
Expand All @@ -23,7 +23,7 @@ class Operation
/**
* @param string|null $id
* @param array $tags
* @param \Vyuldashev\LaravelOpenApi\Factories\SecuritySchemeFactory|string|null $security
* @param \NovaEdge\LaravelOpenApi\Factories\SecuritySchemeFactory|string|null $security
* @param string|null $method
*
* @throws InvalidArgumentException
Expand Down
4 changes: 2 additions & 2 deletions src/Attributes/Parameters.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Vyuldashev\LaravelOpenApi\Attributes;
namespace NovaEdge\LaravelOpenApi\Attributes;

use Attribute;
use InvalidArgumentException;
use Vyuldashev\LaravelOpenApi\Factories\ParametersFactory;
use NovaEdge\LaravelOpenApi\Factories\ParametersFactory;

#[Attribute(Attribute::TARGET_METHOD)]
class Parameters
Expand Down
2 changes: 1 addition & 1 deletion src/Attributes/PathItem.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Vyuldashev\LaravelOpenApi\Attributes;
namespace NovaEdge\LaravelOpenApi\Attributes;

use Attribute;

Expand Down
4 changes: 2 additions & 2 deletions src/Attributes/RequestBody.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Vyuldashev\LaravelOpenApi\Attributes;
namespace NovaEdge\LaravelOpenApi\Attributes;

use Attribute;
use InvalidArgumentException;
use Vyuldashev\LaravelOpenApi\Factories\RequestBodyFactory;
use NovaEdge\LaravelOpenApi\Factories\RequestBodyFactory;

#[Attribute(Attribute::TARGET_METHOD)]
class RequestBody
Expand Down
4 changes: 2 additions & 2 deletions src/Attributes/Response.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Vyuldashev\LaravelOpenApi\Attributes;
namespace NovaEdge\LaravelOpenApi\Attributes;

use Attribute;
use InvalidArgumentException;
use Vyuldashev\LaravelOpenApi\Factories\ResponseFactory;
use NovaEdge\LaravelOpenApi\Factories\ResponseFactory;

#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
class Response
Expand Down
8 changes: 4 additions & 4 deletions src/Builders/Components/Builder.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

namespace Vyuldashev\LaravelOpenApi\Builders\Components;
namespace NovaEdge\LaravelOpenApi\Builders\Components;

use Illuminate\Support\Collection;
use ReflectionClass;
use Vyuldashev\LaravelOpenApi\Attributes\Collection as CollectionAttribute;
use Vyuldashev\LaravelOpenApi\ClassMapGenerator;
use Vyuldashev\LaravelOpenApi\Generator;
use NovaEdge\LaravelOpenApi\Attributes\Collection as CollectionAttribute;
use NovaEdge\LaravelOpenApi\ClassMapGenerator;
use NovaEdge\LaravelOpenApi\Generator;

abstract class Builder
{
Expand Down
8 changes: 4 additions & 4 deletions src/Builders/Components/CallbacksBuilder.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Vyuldashev\LaravelOpenApi\Builders\Components;
namespace NovaEdge\LaravelOpenApi\Builders\Components;

use Vyuldashev\LaravelOpenApi\Contracts\Reusable;
use Vyuldashev\LaravelOpenApi\Factories\CallbackFactory;
use Vyuldashev\LaravelOpenApi\Generator;
use NovaEdge\LaravelOpenApi\Contracts\Reusable;
use NovaEdge\LaravelOpenApi\Factories\CallbackFactory;
use NovaEdge\LaravelOpenApi\Generator;

class CallbacksBuilder extends Builder
{
Expand Down
Loading