diff --git a/composer.json b/composer.json index 183766a..3595125 100644 --- a/composer.json +++ b/composer.json @@ -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/" } }, @@ -47,7 +47,7 @@ "extra": { "laravel": { "providers": [ - "Vyuldashev\\LaravelOpenApi\\OpenApiServiceProvider" + "NovaEdge\\LaravelOpenApi\\OpenApiServiceProvider" ] } }, diff --git a/docs/README.md b/docs/README.md index 0ab9150..5a3666e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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 diff --git a/docs/middlewares.md b/docs/middlewares.md index 61f1902..9eeaf2c 100644 --- a/docs/middlewares.md +++ b/docs/middlewares.md @@ -4,7 +4,7 @@ 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. @@ -12,7 +12,7 @@ Available lifecycle points are: ### 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. diff --git a/docs/paths/operations.md b/docs/paths/operations.md index 7ddeadc..0ce563c 100644 --- a/docs/paths/operations.md +++ b/docs/paths/operations.md @@ -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 @@ -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 { @@ -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 { diff --git a/docs/paths/parameters.md b/docs/paths/parameters.md index 8a1666e..7046b3a 100644 --- a/docs/paths/parameters.md +++ b/docs/paths/parameters.md @@ -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: @@ -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() { // } @@ -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] diff --git a/docs/paths/request-bodies.md b/docs/paths/request-bodies.md index 39062c0..d44fca7 100644 --- a/docs/paths/request-bodies.md +++ b/docs/paths/request-bodies.md @@ -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 @@ -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 { diff --git a/docs/paths/responses.md b/docs/paths/responses.md index e69e818..289eb92 100644 --- a/docs/paths/responses.md +++ b/docs/paths/responses.md @@ -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 { @@ -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 { @@ -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 { @@ -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 { diff --git a/docs/schemas.md b/docs/schemas.md index a006d74..9c27d5f 100644 --- a/docs/schemas.md +++ b/docs/schemas.md @@ -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; diff --git a/docs/security.md b/docs/security.md index e52260a..8a12e6e 100644 --- a/docs/security.md +++ b/docs/security.md @@ -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 diff --git a/examples/petstore/OpenApi/Parameters/ListPetsParameters.php b/examples/petstore/OpenApi/Parameters/ListPetsParameters.php index ff220f2..9554b25 100644 --- a/examples/petstore/OpenApi/Parameters/ListPetsParameters.php +++ b/examples/petstore/OpenApi/Parameters/ListPetsParameters.php @@ -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 { diff --git a/examples/petstore/OpenApi/Responses/ErrorValidationResponse.php b/examples/petstore/OpenApi/Responses/ErrorValidationResponse.php index 2b28287..2bc97b3 100644 --- a/examples/petstore/OpenApi/Responses/ErrorValidationResponse.php +++ b/examples/petstore/OpenApi/Responses/ErrorValidationResponse.php @@ -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 { diff --git a/examples/petstore/OpenApi/Schemas/PetSchema.php b/examples/petstore/OpenApi/Schemas/PetSchema.php index 250e406..c2ed922 100644 --- a/examples/petstore/OpenApi/Schemas/PetSchema.php +++ b/examples/petstore/OpenApi/Schemas/PetSchema.php @@ -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 { diff --git a/examples/petstore/PetController.php b/examples/petstore/PetController.php index 918b8c5..7839b26 100644 --- a/examples/petstore/PetController.php +++ b/examples/petstore/PetController.php @@ -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 diff --git a/routes/api.php b/routes/api.php index 8180130..d3c1c05 100644 --- a/routes/api.php +++ b/routes/api.php @@ -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) { diff --git a/src/Attributes/Callback.php b/src/Attributes/Callback.php index 6f1a848..878a47c 100644 --- a/src/Attributes/Callback.php +++ b/src/Attributes/Callback.php @@ -1,10 +1,10 @@ getAttributes()) ->map(fn (ReflectionAttribute $attribute) => $attribute->newInstance()); - $containsControllerLevelParamter = $actionAttributes->contains(fn ($value) => $value instanceof \Vyuldashev\LaravelOpenApi\Attributes\Parameters); + $containsControllerLevelParamter = $actionAttributes->contains(fn ($value) => $value instanceof \NovaEdge\LaravelOpenApi\Attributes\Parameters); $instance->domain = $route->domain(); $instance->method = $method; diff --git a/src/SchemaHelpers.php b/src/SchemaHelpers.php index 4d620c8..3f0d84d 100644 --- a/src/SchemaHelpers.php +++ b/src/SchemaHelpers.php @@ -1,6 +1,6 @@