├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── README.md ├── composer.json ├── src └── SwaggerGeneratorServiceProvider.php └── views ├── controller ├── controller.blade.php ├── destroy.blade.php ├── index.blade.php ├── show.blade.php ├── store.blade.php └── update.blade.php └── model ├── model.blade.php ├── parameter.blade.php └── property.blade.php /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | open_collective: infyomlabs 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | .idea 3 | composer.lock 4 | vendor 5 | **/.DS_Store 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 InfyOm Labs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

InfyOm

2 | 3 | Swagger Generator for InfyOm Laravel Generator 4 | =================================================== 5 | 6 | [![Total Downloads](https://poser.pugx.org/infyomlabs/swagger-generator/downloads)](https://packagist.org/packages/infyomlabs/swagger-generator) 7 | [![Monthly Downloads](https://poser.pugx.org/infyomlabs/swagger-generator/d/monthly)](https://packagist.org/packages/infyomlabs/swagger-generator) 8 | [![Daily Downloads](https://poser.pugx.org/infyomlabs/swagger-generator/d/daily)](https://packagist.org/packages/infyomlabs/swagger-generator) 9 | [![License](https://poser.pugx.org/infyomlabs/swagger-generator/license)](https://packagist.org/packages/infyomlabs/swagger-generator) 10 | 11 | Generate Swagger Docs for APIs along with Generating CRUD APIs with [InfyOm Laravel Generator](https://github.com/InfyOmLabs/laravel-generator). 12 | 13 | ## Documentation 14 | 15 | Read [Documentation](https://infyom.com/open-source/laravelgenerator/docs/generator-options#swagger) for detailed installation steps and usage. 16 | 17 | ## Support Us 18 | 19 | We have created [14+ Laravel packages](https://github.com/InfyOmLabs) and invested a lot of resources into creating these all packages and maintaining them. 20 | 21 | You can support us by either sponsoring us or buying one of our paid products. Or help us by spreading the word about us on social platforms via tweets and posts. 22 | 23 | ### Buy our Paid Products 24 | 25 | [![InfyGPT](https://assets.infyom.com/open-source/infygpt-inline.png)](https://bit.ly/infy-gpt) 26 | 27 | You can also check out our other paid products on [CodeCanyon](https://1.envato.market/BXAnR1). 28 | 29 | ### Sponsors 30 | 31 | [Become a sponsor](https://opencollective.com/infyomlabs#sponsor) and get your logo on our README on Github with a link to your site. 32 | 33 | 34 | 35 | ### Backers 36 | 37 | [Become a backer](https://opencollective.com/infyomlabs#backer) and get your image on our README on Github with a link to your site. 38 | 39 | 40 | 41 | ### Follow Us 42 | 43 | - [Twitter](https://twitter.com/infyom) 44 | - [Facebook](https://www.facebook.com/infyom) 45 | - [LinkedIn](https://in.linkedin.com/company/infyom-technologies) 46 | - [Youtube](https://www.youtube.com/channel/UC8IvwfChD6i7Wp4yZp3tNsQ) 47 | - [Contact Us](https://infyom.com/contact-us) 48 | 49 | ## Made with InfyOm Generator 50 | 51 | Also, Do not forget to add your website to [Made with InfyOm Generator List](https://github.com/InfyOmLabs/laravel-generator/blob/develop/made-with-generator.md) list. 52 | 53 | ## Security 54 | 55 | If you discover any security-related issues, create an issue using the issue tracker. 56 | 57 | ## Credits 58 | 59 | - [InfyOm Technologies](https://github.com/infyomlabs) 60 | - [All Contributors](../../contributors) 61 | 62 | ## License 63 | 64 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 65 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "infyomlabs/swagger-generator", 3 | "description": "Swagger Generator for InfyOm Laravel Generator", 4 | "keywords": [ 5 | "laravel", 6 | "swagger", 7 | "templates", 8 | "generator" 9 | ], 10 | "license": "MIT", 11 | "authors": [ 12 | { 13 | "name": "Mitul Golakiya", 14 | "email": "me@mitul.me" 15 | } 16 | ], 17 | "require": { 18 | "php": ">=5.5.9", 19 | "illuminate/support": "^6.0|^7.0|^8.0|^9.0|^10.0" 20 | }, 21 | "autoload": { 22 | "psr-4": { 23 | "InfyOm\\SwaggerGenerator\\": "src/" 24 | } 25 | }, 26 | "extra": { 27 | "laravel": { 28 | "providers": [ 29 | "\\InfyOm\\SwaggerGenerator\\SwaggerGeneratorServiceProvider" 30 | ] 31 | } 32 | }, 33 | "funding": [ 34 | { 35 | "type": "opencollective", 36 | "url": "https://opencollective.com/infyomlabs" 37 | } 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /src/SwaggerGeneratorServiceProvider.php: -------------------------------------------------------------------------------- 1 | loadViewsFrom(__DIR__.'/../views', 'swagger-generator'); 17 | $this->publishes([ 18 | __DIR__.'/../views' => resource_path('views/vendor/swagger-generator'), 19 | ], 'swagger-generator-templates'); 20 | } 21 | 22 | /** 23 | * Register the application services. 24 | * 25 | * @return void 26 | */ 27 | public function register() 28 | { 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /views/controller/controller.blade.php: -------------------------------------------------------------------------------- 1 | /** 2 | * Class {{ $config->modelNames->name }}Controller 3 | */ 4 | -------------------------------------------------------------------------------- /views/controller/destroy.blade.php: -------------------------------------------------------------------------------- 1 | /** 2 | * @OA\Delete( 3 | * path="/{{ $config->modelNames->dashedPlural }}/{id}", 4 | * summary="delete{{ $config->modelNames->name }}", 5 | * tags={"{{ $config->modelNames->name }}"}, 6 | * description="Delete {{ $config->modelNames->name }}", 7 | * @OA\Parameter( 8 | * name="id", 9 | * description="id of {{ $config->modelNames->name }}", 10 | * @OA\Schema( 11 | * type="integer" 12 | * ), 13 | * required=true, 14 | * in="path" 15 | * ), 16 | * @OA\Response( 17 | * response=200, 18 | * description="successful operation", 19 | * @OA\JsonContent( 20 | * type="object", 21 | * @OA\Property( 22 | * property="success", 23 | * type="boolean" 24 | * ), 25 | * @OA\Property( 26 | * property="data", 27 | * type="string" 28 | * ), 29 | * @OA\Property( 30 | * property="message", 31 | * type="string" 32 | * ) 33 | * ) 34 | * ) 35 | * ) 36 | */ -------------------------------------------------------------------------------- /views/controller/index.blade.php: -------------------------------------------------------------------------------- 1 | /** 2 | * @OA\Get( 3 | * path="/{{ $config->modelNames->dashedPlural }}", 4 | * summary="get{{ $config->modelNames->name }}List", 5 | * tags={"{{ $config->modelNames->name }}"}, 6 | * description="Get all {{ $config->modelNames->plural }}", 7 | * @OA\Response( 8 | * response=200, 9 | * description="successful operation", 10 | * @OA\JsonContent( 11 | * type="object", 12 | * @OA\Property( 13 | * property="success", 14 | * type="boolean" 15 | * ), 16 | * @OA\Property( 17 | * property="data", 18 | * type="array", 19 | * @OA\Items(ref="#/components/schemas/{{ $config->modelNames->name }}") 20 | * ), 21 | * @OA\Property( 22 | * property="message", 23 | * type="string" 24 | * ) 25 | * ) 26 | * ) 27 | * ) 28 | */ -------------------------------------------------------------------------------- /views/controller/show.blade.php: -------------------------------------------------------------------------------- 1 | /** 2 | * @OA\Get( 3 | * path="/{{ $config->modelNames->dashedPlural }}/{id}", 4 | * summary="get{{ $config->modelNames->name }}Item", 5 | * tags={"{{ $config->modelNames->name }}"}, 6 | * description="Get {{ $config->modelNames->name }}", 7 | * @OA\Parameter( 8 | * name="id", 9 | * description="id of {{ $config->modelNames->name }}", 10 | * @OA\Schema( 11 | * type="integer" 12 | * ), 13 | * required=true, 14 | * in="path" 15 | * ), 16 | * @OA\Response( 17 | * response=200, 18 | * description="successful operation", 19 | * @OA\JsonContent( 20 | * type="object", 21 | * @OA\Property( 22 | * property="success", 23 | * type="boolean" 24 | * ), 25 | * @OA\Property( 26 | * property="data", 27 | * ref="#/components/schemas/{{ $config->modelNames->name }}" 28 | * ), 29 | * @OA\Property( 30 | * property="message", 31 | * type="string" 32 | * ) 33 | * ) 34 | * ) 35 | * ) 36 | */ -------------------------------------------------------------------------------- /views/controller/store.blade.php: -------------------------------------------------------------------------------- 1 | /** 2 | * @OA\Post( 3 | * path="/{{ $config->modelNames->dashedPlural }}", 4 | * summary="create{{ $config->modelNames->name }}", 5 | * tags={"{{ $config->modelNames->name }}"}, 6 | * description="Create {{ $config->modelNames->name }}", 7 | * @OA\RequestBody( 8 | * required=true, 9 | * @OA\JsonContent(ref="#/components/schemas/{{ $config->modelNames->name }}") 10 | * ), 11 | * @OA\Response( 12 | * response=200, 13 | * description="successful operation", 14 | * @OA\JsonContent( 15 | * type="object", 16 | * @OA\Property( 17 | * property="success", 18 | * type="boolean" 19 | * ), 20 | * @OA\Property( 21 | * property="data", 22 | * ref="#/components/schemas/{{ $config->modelNames->name }}" 23 | * ), 24 | * @OA\Property( 25 | * property="message", 26 | * type="string" 27 | * ) 28 | * ) 29 | * ) 30 | * ) 31 | */ -------------------------------------------------------------------------------- /views/controller/update.blade.php: -------------------------------------------------------------------------------- 1 | /** 2 | * @OA\Put( 3 | * path="/{{ $config->modelNames->dashedPlural }}/{id}", 4 | * summary="update{{ $config->modelNames->name }}", 5 | * tags={"{{ $config->modelNames->name }}"}, 6 | * description="Update {{ $config->modelNames->name }}", 7 | * @OA\Parameter( 8 | * name="id", 9 | * description="id of {{ $config->modelNames->name }}", 10 | * @OA\Schema( 11 | * type="integer" 12 | * ), 13 | * required=true, 14 | * in="path" 15 | * ), 16 | * @OA\RequestBody( 17 | * required=true, 18 | * @OA\JsonContent(ref="#/components/schemas/{{ $config->modelNames->name }}") 19 | * ), 20 | * @OA\Response( 21 | * response=200, 22 | * description="successful operation", 23 | * @OA\JsonContent( 24 | * type="object", 25 | * @OA\Property( 26 | * property="success", 27 | * type="boolean" 28 | * ), 29 | * @OA\Property( 30 | * property="data", 31 | * ref="#/components/schemas/{{ $config->modelNames->name }}" 32 | * ), 33 | * @OA\Property( 34 | * property="message", 35 | * type="string" 36 | * ) 37 | * ) 38 | * ) 39 | * ) 40 | */ -------------------------------------------------------------------------------- /views/model/model.blade.php: -------------------------------------------------------------------------------- 1 | /** 2 | * @OA\Schema( 3 | * schema="{{ $config->modelNames->name }}", 4 | * required={!! $requiredFields !!}, 5 | {!! $properties !!} 6 | * ) 7 | */ -------------------------------------------------------------------------------- /views/model/parameter.blade.php: -------------------------------------------------------------------------------- 1 | * @OA\Parameter( 2 | * name="{{ $fieldName }}", 3 | * in="query", 4 | * description="{{ $description }}", 5 | * required=false, 6 | * type="{{ $fieldType }}" 7 | * ) -------------------------------------------------------------------------------- /views/model/property.blade.php: -------------------------------------------------------------------------------- 1 | * @OA\Property( 2 | * property="{{ $fieldName }}", 3 | * description="{{ $description }}", 4 | * readOnly={{ $readOnly }}, 5 | * nullable={{ $nullable }}, 6 | * type="{{ $type }}", 7 | @if($format) 8 | * format="{{ $format }}" 9 | @endif 10 | * ) --------------------------------------------------------------------------------