Skip to content

Commit

Permalink
OpenApi: moved to contributte/openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Dec 1, 2023
1 parent 4aa3746 commit eced018
Show file tree
Hide file tree
Showing 68 changed files with 15 additions and 19,861 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"ext-json": "*",
"contributte/psr7-http-message": "^0.9.0 || ^0.10.0",
"contributte/middlewares": "^0.11.0",
"contributte/openapi": "^0.1.0",
"doctrine/annotations": "^1.14.3",
"koriym/attributes": "^1.0.5",
"nette/utils": "^4.0.0"
Expand Down
2 changes: 0 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ parameters:
- message: '#.+(int|string|string\>)\|false.+#'
path: %currentWorkingDirectory%/src/OpenApi/SchemaDefinition/Entity/EntityAdapter.php

- '#Property Apitte\\OpenApi\\Schema\\(\w+)::\$(\w+) is never read, only written.#'

# This should not happen because null is returned on error
- '#Method Apitte\\Core\\Utils\\Helpers::slashless\(\) should return string but returns string\|null\.#'

Expand Down
7 changes: 4 additions & 3 deletions src/OpenApi/DI/OpenApiPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
use Apitte\OpenApi\SchemaDefinition\JsonDefinition;
use Apitte\OpenApi\SchemaDefinition\NeonDefinition;
use Apitte\OpenApi\SchemaDefinition\YamlDefinition;
use Apitte\OpenApi\Tracy\SwaggerUIPanel;
use Contributte\DI\Helper\ExtensionDefinitionsHelper;
use Contributte\OpenApi\Tracy\SwaggerPanel;
use Nette\DI\Definitions\Definition;
use Nette\DI\Definitions\Statement;
use Nette\PhpGenerator\ClassType;
Expand Down Expand Up @@ -93,8 +93,9 @@ public function loadPluginConfiguration(): void
}

$builder->addDefinition($this->prefix('swaggerUi.panel'))
->setFactory(SwaggerUIPanel::class)
->setFactory(SwaggerPanel::class)
->addSetup('setUrl', [$config->swaggerUi->url])
->addSetup('?->setSpecCallback(fn() => ?)', ['@self', new Statement('@' . $this->prefix('schemaBuilder') . '::build')])
->addSetup('setExpansion', [$config->swaggerUi->expansion])
->addSetup('setFilter', [$config->swaggerUi->filter])
->addSetup('setTitle', [$config->swaggerUi->title])
Expand Down Expand Up @@ -129,7 +130,7 @@ protected function getConfigSchema(): Schema
'files' => Expect::arrayOf('string'),
'swaggerUi' => Expect::structure([
'url' => Expect::string()->nullable(),
'expansion' => Expect::anyOf(...SwaggerUIPanel::EXPANSIONS)->default(SwaggerUIPanel::EXPANSION_LIST),
'expansion' => Expect::anyOf(...SwaggerPanel::EXPANSIONS)->default(SwaggerPanel::EXPANSION_LIST),
'filter' => Expect::bool(true),
'title' => Expect::string('OpenAPI'),
'panel' => Expect::bool(false),
Expand Down
2 changes: 1 addition & 1 deletion src/OpenApi/ISchemaBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Apitte\OpenApi;

use Apitte\OpenApi\Schema\OpenApi;
use Contributte\OpenApi\Schema\OpenApi;

interface ISchemaBuilder
{
Expand Down
35 changes: 0 additions & 35 deletions src/OpenApi/Schema/Callback.php

This file was deleted.

165 changes: 0 additions & 165 deletions src/OpenApi/Schema/Components.php

This file was deleted.

78 changes: 0 additions & 78 deletions src/OpenApi/Schema/Contact.php

This file was deleted.

Loading

0 comments on commit eced018

Please sign in to comment.