mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Change the way we define and update open api definitions
This commit is contained in:
parent
8df6ce826d
commit
0edc825e5a
74
app/Console/Commands/OpenApiYaml.php
Normal file
74
app/Console/Commands/OpenApiYaml.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use DirectoryIterator;
|
||||
use Faker\Factory;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class OpenApiYaml extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'ninja:openapi';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Build OpenApi YAML';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->faker = Factory::create();
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$path = base_path('openapi');
|
||||
|
||||
$directory = new DirectoryIterator($path);
|
||||
|
||||
$this->info($directory);
|
||||
|
||||
foreach ($directory as $file) {
|
||||
|
||||
$this->info($file);
|
||||
|
||||
Storage::disk('base')->delete('/openapi/api-docs.yaml');
|
||||
Storage::disk('base')->append('/openapi/api-docs.yaml', file_get_contents($path.'/info.yaml'));
|
||||
Storage::disk('base')->append('/openapi/api-docs.yaml', file_get_contents($path.'/paths/paths.yaml'));
|
||||
Storage::disk('base')->append('/openapi/api-docs.yaml', file_get_contents($path.'/components/components.yaml'));
|
||||
Storage::disk('base')->append('/openapi/api-docs.yaml', file_get_contents($path.'/misc/misc.yaml'));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -32,6 +32,22 @@ return [
|
||||
|
||||
'disks' => [
|
||||
|
||||
'base' => [
|
||||
'driver' => 'local',
|
||||
'root' => base_path(),
|
||||
'permissions' => [
|
||||
'file' => [
|
||||
'public' => 0664,
|
||||
'private' => 0600,
|
||||
],
|
||||
'dir' => [
|
||||
'public' => 0775,
|
||||
'private' => 0700,
|
||||
],
|
||||
],
|
||||
'throw' => false,
|
||||
],
|
||||
|
||||
'local' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app'),
|
||||
|
@ -161,7 +161,7 @@ return [
|
||||
/*
|
||||
* Set this to `true` to generate a copy of documentation in yaml format
|
||||
*/
|
||||
'generate_yaml_copy' => env('L5_SWAGGER_GENERATE_YAML_COPY', false),
|
||||
'generate_yaml_copy' => env('L5_SWAGGER_GENERATE_YAML_COPY', true),
|
||||
|
||||
/*
|
||||
* Edit to trust the proxy's ip address - needed for AWS Load Balancer
|
||||
|
19053
openapi/api-docs.yaml
Normal file
19053
openapi/api-docs.yaml
Normal file
File diff suppressed because it is too large
Load Diff
4099
openapi/components/components.yaml
Normal file
4099
openapi/components/components.yaml
Normal file
File diff suppressed because it is too large
Load Diff
17
openapi/info.yaml
Normal file
17
openapi/info.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
title: 'Invoice Ninja'
|
||||
description: |
|
||||
# Invoice Ninja.
|
||||
## Self hosted Invoicing lives here.
|
||||
termsOfService: 'https://invoiceninja.github.io/docs/legal/terms_of_service/#page-content'
|
||||
contact:
|
||||
email: contact@invoiceninja.com
|
||||
license:
|
||||
name: 'Elastic License'
|
||||
url: 'https://www.elastic.co/licensing/elastic-license'
|
||||
version: 1.0.30
|
||||
servers:
|
||||
-
|
||||
url: 'https://demo.invoiceninja.com'
|
||||
description: 'Demo API Server InvoiceNinja, you can use the demo API key `TOKEN` to test the endpoints.'
|
12
openapi/misc/misc.yaml
Normal file
12
openapi/misc/misc.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
tags:
|
||||
-
|
||||
name: login
|
||||
description: Authentication
|
||||
externalDocs:
|
||||
description: 'Find out more'
|
||||
url: 'https://invoiceninja.github.io'
|
||||
externalDocs:
|
||||
description: 'https://invoiceninja.github.io'
|
||||
url: 'https://invoiceninja.github.io'
|
||||
security:
|
||||
- []
|
14925
openapi/paths/paths.yaml
Normal file
14925
openapi/paths/paths.yaml
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user