From 19581464b2a6f583e85fd471c72e42ead0b455a3 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Thu, 28 Oct 2021 08:55:06 +0200 Subject: [PATCH 001/121] Adjust default value for Schema:: when no type is specified fixes #131 --- src/spec/Schema.php | 4 ++++ tests/spec/SchemaTest.php | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/spec/Schema.php b/src/spec/Schema.php index 59eb425c..b8c0709e 100644 --- a/src/spec/Schema.php +++ b/src/spec/Schema.php @@ -124,6 +124,10 @@ protected function attributeDefaults(): array 'allOf' => null, 'oneOf' => null, 'anyOf' => null, + // nullable is only relevant, when a type is specified + // return null as default when there is no type + // return false as default when there is a type + 'nullable' => $this->hasProperty('type') ? false : null, ]; } diff --git a/tests/spec/SchemaTest.php b/tests/spec/SchemaTest.php index be53dd9b..0e19f74e 100644 --- a/tests/spec/SchemaTest.php +++ b/tests/spec/SchemaTest.php @@ -43,6 +43,29 @@ public function testRead() $this->assertFalse($schema->deprecated); } + public function testNullable() + { + /** @var $schema Schema */ + $schema = Reader::readFromJson('{"type": "string"}', Schema::class); + $this->assertEquals(Type::STRING, $schema->type); + $this->assertFalse($schema->nullable); + + /** @var $schema Schema */ + $schema = Reader::readFromJson('{"type": "string", "nullable": false}', Schema::class); + $this->assertEquals(Type::STRING, $schema->type); + $this->assertFalse($schema->nullable); + + /** @var $schema Schema */ + $schema = Reader::readFromJson('{"type": "string", "nullable": true}', Schema::class); + $this->assertEquals(Type::STRING, $schema->type); + $this->assertTrue($schema->nullable); + + // nullable is undefined if no type is given + $schema = Reader::readFromJson('{"oneOf": [{"type": "string"}, {"type": "integer"}]}', Schema::class); + $this->assertNull($schema->type); + $this->assertNull($schema->nullable); + } + public function testReadObject() { /** @var $schema Schema */ From eb1fc2858da4bdc3a6c2d00e2a7740a7a5fcc068 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Tue, 21 Dec 2021 14:44:05 +0100 Subject: [PATCH 002/121] Drop licence badge from readme (#137) Licence information is already natively displayed on Github and Packagist so there's no need for having a badge --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0510a908..82a782f7 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ It also provides a CLI tool for validating and converting OpenAPI 3.0.x Descript [![Latest Stable Version](https://poser.pugx.org/cebe/php-openapi/v/stable)](https://packagist.org/packages/cebe/php-openapi) [![Total Downloads](https://poser.pugx.org/cebe/php-openapi/downloads)](https://packagist.org/packages/cebe/php-openapi) [![Build Status](https://github.com/cebe/php-openapi/workflows/PHP%20Composer/badge.svg)](https://github.com/cebe/php-openapi/actions) -[![License](https://poser.pugx.org/cebe/php-openapi/license)](https://packagist.org/packages/cebe/php-openapi) ## Install From 41db38d16ba157d4a1002b3087f43be3dabf9a2e Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Tue, 21 Dec 2021 15:02:45 +0100 Subject: [PATCH 003/121] Run all tests (#136) --- tests/ReaderTest.php | 17 ----------------- tests/spec/OpenApiTest.php | 16 ---------------- 2 files changed, 33 deletions(-) diff --git a/tests/ReaderTest.php b/tests/ReaderTest.php index 6e961ab6..435a8e08 100644 --- a/tests/ReaderTest.php +++ b/tests/ReaderTest.php @@ -89,25 +89,8 @@ private function assertApiContent(\cebe\openapi\spec\OpenApi $openapi) $this->assertEquals("1.0.0", $openapi->info->version); } - /** - * @see https://github.com/symfony/symfony/issues/34805 - */ public function testSymfonyYamlBugHunt() { - // skip test on symfony/yaml 5.0 due to bug https://github.com/symfony/symfony/issues/34805 - $installed = json_decode(file_get_contents(__DIR__ . '/../vendor/composer/installed.json'), true); - // Check for composer 2.0 structure - if (array_key_exists('packages', $installed)) { - $installed = $installed['packages']; - } - foreach($installed as $pkg) { - if ($pkg['name'] === 'symfony/yaml' && version_compare($pkg['version'], 'v4.4', '>=')) { - $this->markTestSkipped( - 'This test is incompatible with symfony/yaml 4.4 and 5.0, see symfony bug https://github.com/symfony/symfony/issues/34805' - ); - } - } - $openApiFile = __DIR__ . '/../vendor/oai/openapi-specification/examples/v3.0/uspto.yaml'; $openapi = \cebe\openapi\Reader::readFromYamlFile($openApiFile); diff --git a/tests/spec/OpenApiTest.php b/tests/spec/OpenApiTest.php index bf321f1b..20b568ed 100644 --- a/tests/spec/OpenApiTest.php +++ b/tests/spec/OpenApiTest.php @@ -188,22 +188,6 @@ public function specProvider() */ public function testSpecs($openApiFile) { - // skip test on symfony/yaml 5.0 due to bug https://github.com/symfony/symfony/issues/34805 - if ($openApiFile === 'oai/openapi-specification/examples/v3.0/uspto.yaml') { - $installed = json_decode(file_get_contents(__DIR__ . '/../../vendor/composer/installed.json'), true); - // Check for composer 2.0 structure - if (array_key_exists('packages', $installed)) { - $installed = $installed['packages']; - } - foreach ($installed as $pkg) { - if ($pkg['name'] === 'symfony/yaml' && version_compare($pkg['version'], 'v4.4', '>=')) { - $this->markTestSkipped( - 'This test is incompatible with symfony/yaml 4.4 and 5.0, see symfony bug https://github.com/symfony/symfony/issues/34805' - ); - } - } - } - if (strtolower(substr($openApiFile, -5, 5)) === '.json') { $json = json_decode(file_get_contents(__DIR__ . '/../../vendor/' . $openApiFile), true); $openapi = new OpenApi($json); From 3c3a8ef299c7b3e3110ab97e2e3c74486cb65aa8 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Sun, 26 Dec 2021 10:43:12 +0100 Subject: [PATCH 004/121] Rework CI - Use ramsey/composer-install action - Drop testing on multiple OSes as it's not relevant - Move timezone setting to bootstrap file - Run standalone PHPStan and Code Style checks - Bump justinrainbow/json-schema to v5.2 as it supports PHP 8.0 - Conflict with symfony/yaml `3.4.0 - 3.4.4 || 4.0.0 - 4.4.17 || 5.0.0 - 5.1.9 || 5.2.0` in order to prevent installing broken versions (especially this issue https://github.com/symfony/symfony/issues/39521) --- .github/workflows/code-style.yml | 21 +++++++ .github/workflows/php.yml | 94 +++++++++----------------------- .github/workflows/phpstan.yml | 25 +++++++++ Makefile | 2 +- composer.json | 8 ++- tests/bootstrap.php | 2 + 6 files changed, 81 insertions(+), 71 deletions(-) create mode 100644 .github/workflows/code-style.yml create mode 100644 .github/workflows/phpstan.yml diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml new file mode 100644 index 00000000..28818d8c --- /dev/null +++ b/.github/workflows/code-style.yml @@ -0,0 +1,21 @@ +name: Code Style + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + code-style: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.1 + + - name: Check code style + run: make check-style diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index ccd13c23..8d3361b4 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -1,4 +1,4 @@ -name: PHP Composer +name: Tests on: push: @@ -7,35 +7,32 @@ on: branches: [ master ] jobs: - build: - + phpunit: + name: Tests + runs-on: ubuntu-latest strategy: fail-fast: false matrix: -# os: [ubuntu-latest, macos-latest, windows-latest] - os: [ubuntu-latest] - php: ['7.1', '7.2', '7.3', '7.4', '8.0'] - # max 4.4.16, see https://github.com/symfony/symfony/issues/39521 - # max 5.1.8, see https://github.com/symfony/symfony/issues/39521 - yaml: ['5.2.9', '5.1.11', '4.4.24', '^3.4'] + php: + - "7.1" + - "7.2" + - "7.3" + - "7.4" + - "8.0" + dependencies: + - "lowest" + - "highest" + symfony-yaml: ['^3.4', '^4', '^5'] exclude: - # Symfony YAML does not run on PHP 7.1 - - php: '7.1' - yaml: '5.1.11' + # symfony/yaml v5 does not run on PHP 7.1 - php: '7.1' - yaml: '5.2.9' - include: - - php: '7.4' - os: windows-latest - yaml: '5.2.9' - - php: '7.4' - os: macos-latest - yaml: '5.2.9' + symfony-yaml: '^5' + # symfony/yaml v3.4 is not compatible with PHP 8.0 but has no upper-bound, so it installs on it + - php: '8.0' + symfony-yaml: '^3.4' - - runs-on: ${{ matrix.os }} env: - YAML: ${{ matrix.yaml }} + SYMFONY_YAML: ${{ matrix.symfony-yaml }} steps: - uses: actions/checkout@v2 @@ -44,60 +41,23 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - ini-values: date.timezone='UTC' coverage: pcov tools: composer:v2 - - name: Determine composer cache directory (Linux/MacOS) - if: matrix.os != 'windows-latest' - run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV - - - name: Determine composer cache directory (Windows) - if: matrix.os == 'windows-latest' - run: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - - name: Cache dependencies installed with composer - uses: actions/cache@v2 - with: - path: ${{ env.COMPOSER_CACHE_DIR }} - key: php${{ matrix.php }}-os${{ matrix.os }}-yaml${{ matrix.yaml }}-composer-${{ hashFiles('**/composer.json') }} - - - - name: Validate composer.json and composer.lock - run: composer validate --ansi - - - name: Install dependencies (Linux/MacOS) - if: matrix.os != 'windows-latest' + - name: Require specific symfony/yaml version run: | - make install - composer require symfony/yaml:"${YAML}" --prefer-dist --no-interaction --ansi + composer require symfony/yaml:"${SYMFONY_YAML}" --prefer-dist --no-interaction --ansi --no-install - - name: Install dependencies (Windows) - if: matrix.os == 'windows-latest' - run: | - composer install --prefer-dist --no-interaction --no-progress --ansi - composer require symfony/yaml:5.1.8 --prefer-dist --no-interaction --ansi + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v2" + with: + dependency-versions: "${{ matrix.dependencies }}" - name: Validate test data - if: matrix.os == 'ubuntu-latest' run: make lint - - name: PHP Stan analysis - if: matrix.os == 'ubuntu-latest' - run: make stan - - - name: PHPUnit tests (Linux/MacOS) - if: matrix.os != 'windows-latest' + - name: PHPUnit tests run: make test - - name: PHPUnit tests (Windows) - if: matrix.os == 'windows-latest' - run: vendor/bin/phpunit --colors=always - - - name: Check code style - if: matrix.os == 'ubuntu-latest' - run: make check-style - - name: Code coverage - if: matrix.os == 'ubuntu-latest' run: make coverage diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 00000000..20c54421 --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,25 @@ +name: PHPStan + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + phpstan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "7.1" + tools: composer:v2 + + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v2" + + - name: PHPStan analysis + run: make stan diff --git a/Makefile b/Makefile index 627df52f..087f09bf 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ test: php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion.json php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion2.yaml -lint: +lint: install php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/reference/playlist.json php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion.json php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion2.yaml diff --git a/composer.json b/composer.json index 941ca3e9..61bf314e 100644 --- a/composer.json +++ b/composer.json @@ -20,19 +20,21 @@ "require": { "php": ">=7.1.0", "ext-json": "*", - "symfony/yaml": "^3.4 | ^4.0 | ^5.0", - "justinrainbow/json-schema": "^5.0" + "symfony/yaml": "^3.4 || ^4 || ^5", + "justinrainbow/json-schema": "^5.2" }, "require-dev": { "cebe/indent": "*", "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", - "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", "apis-guru/openapi-directory": "1.0.0", "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, + "conflict": { + "symfony/yaml": "3.4.0 - 3.4.4 || 4.0.0 - 4.4.17 || 5.0.0 - 5.1.9 || 5.2.0" + }, "autoload": { "psr-4": { "cebe\\openapi\\": "src/" diff --git a/tests/bootstrap.php b/tests/bootstrap.php index fcd2f13a..711b4249 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -9,3 +9,5 @@ } require __DIR__ . '/../vendor/autoload.php'; + +date_default_timezone_set('UTC'); From d5b73b3a260b086a74ea3049b27cdbbdef9fd5a5 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Sun, 26 Dec 2021 10:19:46 +0100 Subject: [PATCH 005/121] Temporarily skip broken test --- tests/spec/SchemaTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/spec/SchemaTest.php b/tests/spec/SchemaTest.php index 0e19f74e..978da349 100644 --- a/tests/spec/SchemaTest.php +++ b/tests/spec/SchemaTest.php @@ -45,6 +45,11 @@ public function testRead() public function testNullable() { + self::markTestIncomplete( + 'Test currently fails as it was not run when https://github.com/cebe/php-openapi/pull/132 was merged. ' + .'See https://github.com/cebe/php-openapi/issues/142 for status' + ); + /** @var $schema Schema */ $schema = Reader::readFromJson('{"type": "string"}', Schema::class); $this->assertEquals(Type::STRING, $schema->type); From 13ba0da837c776892e40f2ebd5ba4169dac10275 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Mon, 3 Jan 2022 18:07:22 +0100 Subject: [PATCH 006/121] Add windows and macos cases --- .github/workflows/php.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 8d3361b4..8aba0b5b 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -9,10 +9,10 @@ on: jobs: phpunit: name: Tests - runs-on: ubuntu-latest strategy: fail-fast: false matrix: + os: [ubuntu-latest] php: - "7.1" - "7.2" @@ -23,6 +23,15 @@ jobs: - "lowest" - "highest" symfony-yaml: ['^3.4', '^4', '^5'] + include: + - os: "windows-latest" + php: "8.0" + dependencies: "highest" + symfony-yaml: '5.4.2' + - os: "macos-latest" + php: "8.0" + dependencies: "highest" + symfony-yaml: '^5' exclude: # symfony/yaml v5 does not run on PHP 7.1 - php: '7.1' @@ -31,8 +40,7 @@ jobs: - php: '8.0' symfony-yaml: '^3.4' - env: - SYMFONY_YAML: ${{ matrix.symfony-yaml }} + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -45,8 +53,7 @@ jobs: tools: composer:v2 - name: Require specific symfony/yaml version - run: | - composer require symfony/yaml:"${SYMFONY_YAML}" --prefer-dist --no-interaction --ansi --no-install + run: "composer require symfony/yaml:'${{ matrix.symfony-yaml }}' --prefer-dist --no-interaction --ansi --no-install" - name: "Install dependencies with Composer" uses: "ramsey/composer-install@v2" From a0086548a05598edffc9492d9ce5137f5aea0b19 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Mon, 3 Jan 2022 20:06:41 +0100 Subject: [PATCH 007/121] Run speccy through yarn --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 087f09bf..1862fdac 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,8 @@ lint: install php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/reference/playlist.json php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion.json php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion2.yaml - node_modules/.bin/speccy lint tests/spec/data/reference/playlist.json - node_modules/.bin/speccy lint tests/spec/data/recursion.json + yarn run speccy lint tests/spec/data/reference/playlist.json + yarn run speccy lint tests/spec/data/recursion.json stan: php $(PHPARGS) vendor/bin/phpstan analyse -l 5 src From 3a028ef9bd2ff507a83e02572a0f68424c1e84c7 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Wed, 9 Feb 2022 09:43:16 +0100 Subject: [PATCH 008/121] Temporarily skip broken test (#145) --- tests/spec/SchemaTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/spec/SchemaTest.php b/tests/spec/SchemaTest.php index 0e19f74e..978da349 100644 --- a/tests/spec/SchemaTest.php +++ b/tests/spec/SchemaTest.php @@ -45,6 +45,11 @@ public function testRead() public function testNullable() { + self::markTestIncomplete( + 'Test currently fails as it was not run when https://github.com/cebe/php-openapi/pull/132 was merged. ' + .'See https://github.com/cebe/php-openapi/issues/142 for status' + ); + /** @var $schema Schema */ $schema = Reader::readFromJson('{"type": "string"}', Schema::class); $this->assertEquals(Type::STRING, $schema->type); From 5855630a5e2ba819484e9b3bea83f03156bec640 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Wed, 9 Feb 2022 09:50:22 +0100 Subject: [PATCH 009/121] Fix CI badge in Readme (#150) --- .github/workflows/php.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 8aba0b5b..e2ed659a 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -1,4 +1,4 @@ -name: Tests +name: CI on: push: diff --git a/README.md b/README.md index 82a782f7..02b31ca2 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ It also provides a CLI tool for validating and converting OpenAPI 3.0.x Descript [![Latest Stable Version](https://poser.pugx.org/cebe/php-openapi/v/stable)](https://packagist.org/packages/cebe/php-openapi) [![Total Downloads](https://poser.pugx.org/cebe/php-openapi/downloads)](https://packagist.org/packages/cebe/php-openapi) -[![Build Status](https://github.com/cebe/php-openapi/workflows/PHP%20Composer/badge.svg)](https://github.com/cebe/php-openapi/actions) +[![Build Status](https://github.com/cebe/php-openapi/workflows/CI/badge.svg)](https://github.com/cebe/php-openapi/actions) ## Install From 9e2e001d48b9ff9945173653118e5c8b2d354615 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Feb 2022 09:50:51 +0100 Subject: [PATCH 010/121] Bump node-fetch from 2.6.1 to 2.6.7 (#149) Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.1 to 2.6.7. - [Release notes](https://github.com/node-fetch/node-fetch/releases) - [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.1...v2.6.7) --- updated-dependencies: - dependency-name: node-fetch dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 97a3e8b9..e85c2a8e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -819,9 +819,11 @@ node-fetch-h2@^2.3.0: http2-client "^1.2.5" node-fetch@^2.3.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + version "2.6.7" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" + integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== + dependencies: + whatwg-url "^5.0.0" node-readfiles@^0.2.0: version "0.2.0" @@ -1386,6 +1388,11 @@ toidentifier@1.0.0: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + tslib@^1.9.3: version "1.10.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" @@ -1414,6 +1421,19 @@ vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" From cad4f7539e70c3acc1bd5d254c68d01e3f8e73de Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 9 Feb 2022 10:36:14 +0100 Subject: [PATCH 011/121] Add symfony 6 support (#151) * Add symfony 6 support * Update php.yml * Update php.yml --- .github/workflows/php.yml | 11 ++++++++++- composer.json | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index e2ed659a..b60478ab 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -22,7 +22,7 @@ jobs: dependencies: - "lowest" - "highest" - symfony-yaml: ['^3.4', '^4', '^5'] + symfony-yaml: ['^3.4', '^4', '^5', '^6'] include: - os: "windows-latest" php: "8.0" @@ -36,6 +36,15 @@ jobs: # symfony/yaml v5 does not run on PHP 7.1 - php: '7.1' symfony-yaml: '^5' + # symfony/yaml v6 does not run on PHP 7.* + - php: '7.1' + symfony-yaml: '^6' + - php: '7.2' + symfony-yaml: '^6' + - php: '7.3' + symfony-yaml: '^6' + - php: '7.4' + symfony-yaml: '^6' # symfony/yaml v3.4 is not compatible with PHP 8.0 but has no upper-bound, so it installs on it - php: '8.0' symfony-yaml: '^3.4' diff --git a/composer.json b/composer.json index 61bf314e..46cb26f2 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "require": { "php": ">=7.1.0", "ext-json": "*", - "symfony/yaml": "^3.4 || ^4 || ^5", + "symfony/yaml": "^3.4 || ^4 || ^5 || ^6", "justinrainbow/json-schema": "^5.2" }, "require-dev": { @@ -42,7 +42,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.5.x-dev" + "dev-master": "1.6.x-dev" } }, "bin": [ From 9d64267e3aa7f301dc40f262dc24a402cbe2c2f5 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 9 Feb 2022 11:47:48 +0100 Subject: [PATCH 012/121] Added docker environment for local development --- Makefile | 51 +++++++++++++++++++++++++----------- README.md | 10 ++++++++ docker-compose.yml | 22 ++++++++++++++++ tests/.gitignore | 1 + tests/docker/Dockerfile | 57 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 126 insertions(+), 15 deletions(-) create mode 100644 docker-compose.yml create mode 100644 tests/.gitignore create mode 100644 tests/docker/Dockerfile diff --git a/Makefile b/Makefile index 1862fdac..b26bc5a4 100644 --- a/Makefile +++ b/Makefile @@ -6,34 +6,55 @@ ifeq ($(XDEBUG),1) XPHPARGS=-dzend_extension=xdebug.so -dxdebug.remote_enable=1 -dxdebug.remote_autostart=1 endif +# Run make with IN_DOCKER=1 to run yarn and php commands in a docker container +DOCKER_PHP= +DOCKER_NODE= +IN_DOCKER=0 +ifeq ($(IN_DOCKER),1) +DOCKER_PHP=docker-compose run --rm php +DOCKER_NODE=docker-compose run --rm -w /app node +endif + all: + @echo "the following commands are available:" + @echo "" + @echo "make check-style # check code style" + @echo "make fix-style # fix code style" + @echo "make install # install dependencies" + @echo "make test # run PHPUnit tests" + @echo "make lint # check validity of test data" + @echo "make stan # check code with PHPStan" + @echo "" + @echo "You may add the IN_DOCKER parameter to run a command inside of docker container and not directly." + @echo "make IN_DOCKER=1 ..." + check-style: php-cs-fixer.phar PHP_CS_FIXER_IGNORE_ENV=1 ./php-cs-fixer.phar fix src/ --diff --dry-run fix-style: php-cs-fixer.phar - vendor/bin/indent --tabs composer.json - vendor/bin/indent --spaces .php_cs.dist - ./php-cs-fixer.phar fix src/ --diff + $(DOCKER_PHP) vendor/bin/indent --tabs composer.json + $(DOCKER_PHP) vendor/bin/indent --spaces .php_cs.dist + $(DOCKER_PHP) ./php-cs-fixer.phar fix src/ --diff -install: - composer install --prefer-dist --no-interaction --no-progress --ansi - yarn install +install: composer.lock yarn.lock + $(DOCKER_PHP) composer install --prefer-dist --no-interaction --no-progress --ansi + $(DOCKER_NODE) yarn install test: - php $(PHPARGS) $(XPHPARGS) vendor/bin/phpunit --verbose --colors=always $(TESTCASE) - php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion.json - php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion2.yaml + $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) vendor/bin/phpunit --verbose --colors=always $(TESTCASE) + $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion.json + $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion2.yaml lint: install - php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/reference/playlist.json - php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion.json - php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion2.yaml - yarn run speccy lint tests/spec/data/reference/playlist.json - yarn run speccy lint tests/spec/data/recursion.json + $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/reference/playlist.json + $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion.json + $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion2.yaml + $(DOCKER_NODE) yarn run speccy lint tests/spec/data/reference/playlist.json + $(DOCKER_NODE) yarn run speccy lint tests/spec/data/recursion.json stan: - php $(PHPARGS) vendor/bin/phpstan analyse -l 5 src + $(DOCKER_PHP) php $(PHPARGS) vendor/bin/phpstan analyse -l 5 src # copy openapi3 json schema schemas/openapi-v3.0.json: vendor/oai/openapi-specification/schemas/v3.0/schema.json diff --git a/README.md b/README.md index 02b31ca2..3d25df05 100644 --- a/README.md +++ b/README.md @@ -277,6 +277,16 @@ This library is currently work in progress, the following list tracks completene - [x] OAuth Flow Object - [x] Security Requirement Object +# Development + +You may use the docker environment for local development: + + docker-compose build + make IN_DOCKER=1 install + make IN_DOCKER=1 test + ... + + # Support **Need help with your API project?** diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..83e0b0f5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +version: "3" +services: + php: + build: + dockerfile: tests/docker/Dockerfile + context: . + volumes: + - ./tests/tmp/.composer:/root/.composer:rw + - .:/app + environment: + - TZ=UTC + - TIMEZONE=UTC + - IN_DOCKER=docker + - PHP_XDEBUG_ENABLED=1 + - XDEBUG_CONFIG="remote_host=host.docker.internal" + - PHP_IDE_CONFIG="serverName=Docker" + tty: true + node: + image: node:11 + volumes: +# - ./tests/tmp/.composer:/root/.composer:rw + - .:/app diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 00000000..cad23091 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1 @@ +/tmp \ No newline at end of file diff --git a/tests/docker/Dockerfile b/tests/docker/Dockerfile new file mode 100644 index 00000000..4dce3b53 --- /dev/null +++ b/tests/docker/Dockerfile @@ -0,0 +1,57 @@ +FROM php:7.4-cli + +ENV DEBIAN_FRONTEND=noninteractive + +RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup && \ + echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache +RUN apt-get update && \ + apt-get -y install \ + gnupg2 && \ + apt-key update && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + libzip-dev \ + libonig-dev \ + vim \ + git \ + unzip\ + libxml2-dev \ + curl \ + libcurl4-openssl-dev \ + libssl-dev \ + --no-install-recommends && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && pecl install xdebug-2.9.6 \ + && docker-php-ext-enable xdebug \ + && docker-php-ext-install \ + zip \ + curl \ + mbstring + +# Install composer +ENV COMPOSER_ALLOW_SUPERUSER=1 \ + PHP_USER_ID=33 \ + PHP_ENABLE_XDEBUG=1 \ + COMPOSER_HOME=/root/.composer/ \ + PATH=/app:/app/vendor/bin:/root/.composer/vendor/bin:$PATH + +RUN curl -o /tmp/composer-setup.php https://getcomposer.org/installer \ +&& curl -o /tmp/composer-setup.sig https://composer.github.io/installer.sig \ +# Make sure we're installing what we think we're installing! +&& php -r "if (hash('SHA384', file_get_contents('/tmp/composer-setup.php')) !== trim(file_get_contents('/tmp/composer-setup.sig'))) { unlink('/tmp/composer-setup.php'); echo 'Invalid installer' . PHP_EOL; exit(1); }" \ +&& php /tmp/composer-setup.php --no-ansi --install-dir=/usr/local/bin --filename=composer \ +&& rm -f /tmp/composer-setup.* + +# Enable Xdebug +ENV XDEBUGINI_PATH=/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini + +RUN echo "xdebug.idekey=PHP_STORM" >> $XDEBUGINI_PATH && \ + echo "xdebug.default_enable=1" >> $XDEBUGINI_PATH && \ + echo "xdebug.remote_enable=1" >> $XDEBUGINI_PATH && \ + echo "xdebug.remote_connect_back=1" >> $XDEBUGINI_PATH && \ + echo "xdebug.remote_log=xdebug_remote.log" >> $XDEBUGINI_PATH && \ + echo "xdebug.remote_port=9000" >> $XDEBUGINI_PATH && \ + echo "xdebug.remote_autostart=1" >> $XDEBUGINI_PATH + +WORKDIR /app From 352848b712106027281e938b27243be23ae776c7 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 9 Feb 2022 11:51:09 +0100 Subject: [PATCH 013/121] yarn upgrade --- docker-compose.yml | 2 +- yarn.lock | 731 +++++++++++++++++++++++++-------------------- 2 files changed, 407 insertions(+), 326 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 83e0b0f5..67409934 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,7 @@ services: - PHP_IDE_CONFIG="serverName=Docker" tty: true node: - image: node:11 + image: node:12 volumes: # - ./tests/tmp/.composer:/root/.composer:rw - .:/app diff --git a/yarn.lock b/yarn.lock index e85c2a8e..309d87b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,40 +3,50 @@ "@babel/code-frame@^7.0.0": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" - integrity sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" + integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== dependencies: - "@babel/highlight" "^7.0.0" + "@babel/highlight" "^7.16.7" -"@babel/highlight@^7.0.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" - integrity sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ== +"@babel/helper-validator-identifier@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" + integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== + +"@babel/highlight@^7.16.7": + version "7.16.10" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" + integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw== dependencies: + "@babel/helper-validator-identifier" "^7.16.7" chalk "^2.0.0" - esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.4.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.5.5.tgz#74fba56d35efbeca444091c7850ccd494fd2f132" - integrity sha512-28QvEGyQyNkB0/m2B4FU7IEZGK2NUrcMtT6BZEFALTguLk+AUT6ofsHtPk5QyjAdUkpMJ+/Em+quwz4HOt30AQ== +"@babel/runtime@^7.0.0", "@babel/runtime@^7.12.5": + version "7.17.2" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.2.tgz#66f68591605e59da47523c631416b18508779941" + integrity sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw== dependencies: - regenerator-runtime "^0.13.2" + regenerator-runtime "^0.13.4" "@cloudflare/json-schema-walker@^0.1.1": version "0.1.1" resolved "https://registry.yarnpkg.com/@cloudflare/json-schema-walker/-/json-schema-walker-0.1.1.tgz#d1cc94065327b0b3800158db40cb78124a3476de" integrity sha512-P3n0hEgk1m6uKWgL4Yb1owzXVG4pM70G4kRnDQxZXiVvfCRtaqiHu+ZRiRPzmwGBiLTO1LWc2yR1M8oz0YkXww== +"@exodus/schemasafe@^1.0.0-rc.2": + version "1.0.0-rc.6" + resolved "https://registry.yarnpkg.com/@exodus/schemasafe/-/schemasafe-1.0.0-rc.6.tgz#7985f681564cff4ffaebb5896eb4be20af3aae7a" + integrity sha512-dDnQizD94EdBwEj/fh3zPRa/HWCS9O5au2PuHhZBbuM3xWHxuaKzPBOEWze7Nn0xW68MIpZ7Xdyn1CoCpjKCuQ== + accepts@~1.3.7: - version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== + version "1.3.8" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" + integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" + mime-types "~2.1.34" + negotiator "0.6.3" ajv@^5.5.2: version "5.5.2" @@ -58,6 +68,11 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -65,6 +80,13 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" +ansi-styles@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -82,57 +104,44 @@ async@^1.4.0: resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= -better-ajv-errors@^0.5.2: - version "0.5.7" - resolved "https://registry.yarnpkg.com/better-ajv-errors/-/better-ajv-errors-0.5.7.tgz#246123954161cc0ef124761c55a121c96b0cdce0" - integrity sha512-O7tpXektKWVwYCH5g6Vs3lKD+sJs7JHh5guapmGJd+RTwxhFZEf4FwvbHBURUnoXsTeFaMvGuhTTmEGiHpNi6w== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/runtime" "^7.0.0" - chalk "^2.4.1" - core-js "^2.5.7" - json-to-ast "^2.0.3" - jsonpointer "^4.0.1" - leven "^2.1.0" - -better-ajv-errors@^0.6.1: - version "0.6.4" - resolved "https://registry.yarnpkg.com/better-ajv-errors/-/better-ajv-errors-0.6.4.tgz#1e3c6b93dc11e72c94a0b042594515eb917f2957" - integrity sha512-+spBhtcCzovXWeHpt5dGylFsn3p5l9w+KcUqh/b4MFdLV+q1sT1olxD9izvwi0D3WuP06eVgeZAGLtxtTnUIDg== +better-ajv-errors@^0.6.1, better-ajv-errors@^0.6.7: + version "0.6.7" + resolved "https://registry.yarnpkg.com/better-ajv-errors/-/better-ajv-errors-0.6.7.tgz#b5344af1ce10f434fe02fc4390a5a9c811e470d1" + integrity sha512-PYgt/sCzR4aGpyNy5+ViSQ77ognMnWq7745zM+/flYO4/Yisdtp9wDQW2IKCyVYPUxQt3E/b5GBSwfhd1LPdlg== dependencies: "@babel/code-frame" "^7.0.0" "@babel/runtime" "^7.0.0" chalk "^2.4.1" - core-js "^2.5.7" + core-js "^3.2.1" json-to-ast "^2.0.3" jsonpointer "^4.0.1" - leven "^2.1.0" + leven "^3.1.0" big.js@^5.2.2: version "5.2.2" resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== -body-parser@1.19.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" - integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== +body-parser@1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.1.tgz#1499abbaa9274af3ecc9f6f10396c995943e31d4" + integrity sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA== dependencies: - bytes "3.1.0" + bytes "3.1.1" content-type "~1.0.4" debug "2.6.9" depd "~1.1.2" - http-errors "1.7.2" + http-errors "1.8.1" iconv-lite "0.4.24" on-finished "~2.3.0" - qs "6.7.0" - raw-body "2.4.0" - type-is "~1.6.17" + qs "6.9.6" + raw-body "2.4.2" + type-is "~1.6.18" -bytes@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== +bytes@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.1.tgz#3f018291cb4cbad9accb6e6970bca9c8889e879a" + integrity sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg== call-me-maybe@^1.0.1: version "1.0.1" @@ -158,10 +167,10 @@ chalk@^2.0.0, chalk@^2.4.1: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -classnames@^2.2.0, classnames@^2.2.3, classnames@^2.2.6: - version "2.2.6" - resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce" - integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q== +classnames@^2.2.3, classnames@^2.2.6: + version "2.3.1" + resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e" + integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA== cliui@^3.0.3: version "3.2.0" @@ -181,6 +190,20 @@ cliui@^4.0.0: strip-ansi "^4.0.0" wrap-ansi "^2.0.0" +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +clsx@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.1.1.tgz#98b3134f9abbdf23b2663491ace13c5c03a73188" + integrity sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA== + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -203,22 +226,34 @@ color-convert@^1.9.0: dependencies: color-name "1.1.3" +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + commander@^2.18.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" - integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -content-disposition@0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" - integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== +content-disposition@0.5.4: + version "0.5.4" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" + integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== dependencies: - safe-buffer "5.1.2" + safe-buffer "5.2.1" content-type@~1.0.4: version "1.0.4" @@ -230,15 +265,15 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= -cookie@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" - integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== +cookie@0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" + integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== -core-js@^2.5.7: - version "2.6.9" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" - integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A== +core-js@^3.2.1: + version "3.21.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.21.0.tgz#f479dbfc3dffb035a0827602dd056839a774aa71" + integrity sha512-YUdI3fFu4TF/2WykQ2xzSiTQdldLB4KVuL9WeAy5XONZYt5Cun/fpQvctoKbCgvPhmzADeesTk/j2Rdx77AcKQ== cross-spawn@^6.0.0: version "6.0.5" @@ -279,9 +314,9 @@ destroy@~1.0.4: integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= dom-walk@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018" - integrity sha1-ZyIm3HTI95mtNTB9+TaroRrNYBg= + version "0.1.2" + resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84" + integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w== dompurify@^1.0.10: version "1.0.11" @@ -294,14 +329,19 @@ ee-first@1.1.1: integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= ejs@^2.5.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.6.2.tgz#3a32c63d1cd16d11266cd4703b14fec4e74ab4f6" - integrity sha512-PcW2a0tyTuPHz3tWyYqtK6r1fZ3gp+3Sop8Ph+ZYN81Ob5rwmbHEzaqs10N3BEsaGTkh/ooniXK+WwszGlc2+Q== + version "2.7.4" + resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.7.4.tgz#48661287573dcc53e366c7a1ae52c3a120eec9ba" + integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA== -emojis-list@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +emojis-list@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" + integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== encodeurl@~1.0.2: version "1.0.2" @@ -309,9 +349,9 @@ encodeurl@~1.0.2: integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= end-of-stream@^1.1.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== dependencies: once "^1.4.0" @@ -320,6 +360,11 @@ es6-promise@^3.2.1: resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" integrity sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM= +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" @@ -335,11 +380,6 @@ esprima@^4.0.0: resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= - etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" @@ -364,16 +404,16 @@ execa@^1.0.0: strip-eof "^1.0.0" express@^4.14.0: - version "4.17.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" - integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== + version "4.17.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.17.2.tgz#c18369f265297319beed4e5558753cc8c1364cb3" + integrity sha512-oxlxJxcQlYwqPWKVJJtvQiwHgosH/LrLSPA+H4UxpyvSS6jC5aH+5MoHFM+KABgTOt0APue4w66Ha8jCUo9QGg== dependencies: accepts "~1.3.7" array-flatten "1.1.1" - body-parser "1.19.0" - content-disposition "0.5.3" + body-parser "1.19.1" + content-disposition "0.5.4" content-type "~1.0.4" - cookie "0.4.0" + cookie "0.4.1" cookie-signature "1.0.6" debug "2.6.9" depd "~1.1.2" @@ -387,13 +427,13 @@ express@^4.14.0: on-finished "~2.3.0" parseurl "~1.3.3" path-to-regexp "0.1.7" - proxy-addr "~2.0.5" - qs "6.7.0" + proxy-addr "~2.0.7" + qs "6.9.6" range-parser "~1.2.1" - safe-buffer "5.1.2" - send "0.17.1" - serve-static "1.14.1" - setprototypeof "1.1.1" + safe-buffer "5.2.1" + send "0.17.2" + serve-static "1.14.2" + setprototypeof "1.2.0" statuses "~1.5.0" type-is "~1.6.18" utils-merge "1.0.1" @@ -405,15 +445,20 @@ fast-deep-equal@^1.0.0: integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= fast-json-stable-stringify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fast-safe-stringify@^2.0.7: + version "2.1.1" + resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" + integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== + finalhandler@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" @@ -440,14 +485,14 @@ foreach@^2.0.4: integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= format-util@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/format-util/-/format-util-1.0.3.tgz#032dca4a116262a12c43f4c3ec8566416c5b2d95" - integrity sha1-Ay3KShFiYqEsQ/TD7IVmQWxbLZU= + version "1.0.5" + resolved "https://registry.yarnpkg.com/format-util/-/format-util-1.0.5.tgz#1ffb450c8a03e7bccffe40643180918cc297d271" + integrity sha512-varLbTj0e0yVyRpqQhuWV+8hlePAgaoFRhNFj50BNjEIrw1/DphHSObtqwskVCPWNgzwPoQrZAbfa/SBiicNeg== -forwarded@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" - integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= +forwarded@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" + integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== fresh@0.5.2: version "0.5.2" @@ -459,6 +504,11 @@ get-caller-file@^1.0.1: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + get-stream@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -485,38 +535,27 @@ has-flag@^3.0.0: integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz#b09178f0122184fb95acf525daaecb4d8f45958b" - integrity sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA== + version "3.3.2" + resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" + integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== dependencies: react-is "^16.7.0" -http-errors@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" - integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== +http-errors@1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c" + integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g== dependencies: depd "~1.1.2" inherits "2.0.4" - setprototypeof "1.1.1" + setprototypeof "1.2.0" statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" + toidentifier "1.0.1" http2-client@^1.2.5: - version "1.3.2" - resolved "https://registry.yarnpkg.com/http2-client/-/http2-client-1.3.2.tgz#80e31d90275844c0ccad8020b2de342a538a7971" - integrity sha512-CY9yoIetaoblM5CTrzHc7mJvH1Fo9/XmO6kxRkTCnWbSPq5brQYbtJ7hJrI5nKMYpyqPJYdPN9mkQbRBVvsoSQ== + version "1.3.5" + resolved "https://registry.yarnpkg.com/http2-client/-/http2-client-1.3.5.tgz#20c9dc909e3cc98284dd20af2432c524086df181" + integrity sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA== iconv-lite@0.4.24: version "0.4.24" @@ -525,20 +564,15 @@ iconv-lite@0.4.24: dependencies: safer-buffer ">= 2.1.2 < 3" -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - inherits@2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== ini@^1.3.0: - version "1.3.7" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.7.tgz#a09363e1911972ea16d7a8851005d84cf09a9a84" - integrity sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ== + version "1.3.8" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" + integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== invert-kv@^1.0.0: version "1.0.0" @@ -550,10 +584,10 @@ invert-kv@^2.0.0: resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== -ipaddr.js@1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.0.tgz#37df74e430a0e47550fe54a2defe30d8acd95f65" - integrity sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA== +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== is-fullwidth-code-point@^1.0.0: version "1.0.0" @@ -567,6 +601,11 @@ is-fullwidth-code-point@^2.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -583,9 +622,9 @@ isexe@^2.0.0: integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.12.1, js-yaml@^3.2.3: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -634,9 +673,9 @@ json5@^1.0.1: minimist "^1.2.0" jsonpointer@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" - integrity sha1-T9kss04OnbPInIYi7PUfm5eMbLk= + version "4.1.0" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.1.0.tgz#501fb89986a2389765ba09e6053299ceb4f2c2cc" + integrity sha512-CXcRvMyTlnR53xMcKnuMzfCA5i/nfblTnnr74CZb6C4vG39eu6w51t7nKmU5MfLfbTgGItliNyjO/ciNPDqClg== lcid@^1.0.0: version "1.0.0" @@ -652,18 +691,18 @@ lcid@^2.0.0: dependencies: invert-kv "^2.0.0" -leven@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" - integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= +leven@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" + integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== loader-utils@^1.1.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" - integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== + version "1.4.0" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" + integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== dependencies: big.js "^5.2.2" - emojis-list "^2.0.0" + emojis-list "^3.0.0" json5 "^1.0.1" locate-path@^3.0.0: @@ -718,9 +757,9 @@ mem@^4.0.0: p-is-promise "^2.0.0" memoize-one@^5.0.0: - version "5.0.5" - resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.0.5.tgz#8cd3809555723a07684afafcd6f756072ac75d7e" - integrity sha512-ey6EpYv0tEaIbM/nTDOpHciXUvd+ackQrJgEzBwemhZZIWZjcyodqEcrmqDy2BKRTM3a65kKBV4WtLXJDt26SQ== + version "5.2.1" + resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.2.1.tgz#8337aa3c4335581839ec01c3d594090cebe8f00e" + integrity sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q== merge-descriptors@1.0.1: version "1.0.1" @@ -732,17 +771,17 @@ methods@~1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= -mime-db@1.40.0: - version "1.40.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" - integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA== +mime-db@1.51.0: + version "1.51.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" + integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== -mime-types@~2.1.24: - version "2.1.24" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" - integrity sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ== +mime-types@~2.1.24, mime-types@~2.1.34: + version "2.1.34" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" + integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== dependencies: - mime-db "1.40.0" + mime-db "1.51.0" mime@1.6.0: version "1.6.0" @@ -779,10 +818,10 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= -ms@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== +ms@2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== nconf-yaml@^1.0.2: version "1.0.2" @@ -801,10 +840,10 @@ nconf@^0.10.0: secure-keys "^1.0.0" yargs "^3.19.0" -negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== +negotiator@0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" + integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== nice-try@^1.0.4: version "1.0.5" @@ -844,52 +883,53 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= -oas-kit-common@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/oas-kit-common/-/oas-kit-common-1.0.7.tgz#de67dc19a572d82bd5f9ba2e1f606ad02d1fb30e" - integrity sha512-8+P8gBjN9bGfa5HPgyefO78o394PUwHoQjuD4hM0Bpl56BkcxoyW4MpWMPM6ATm+yIIz4qT1igmuVukUtjP/pQ== +oas-kit-common@^1.0.7, oas-kit-common@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/oas-kit-common/-/oas-kit-common-1.0.8.tgz#6d8cacf6e9097967a4c7ea8bcbcbd77018e1f535" + integrity sha512-pJTS2+T0oGIwgjGpw7sIRU8RQMcUoKCDWFLdBqKB2BNmGpbBMH2sdqAaOXUg8OzonZHU0L7vfJu1mJFEiYDWOQ== dependencies: - safe-json-stringify "^1.2.0" + fast-safe-stringify "^2.0.7" -oas-linter@^3.0.0, oas-linter@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/oas-linter/-/oas-linter-3.0.1.tgz#41e577549a01c93a0c9fe8422f499d1ff0a9acfd" - integrity sha512-vk8Pzqq8iZM8V0/8NJMHAbf4CMyAUnLTJPNKwCkFl6g2W7omomL3yPpseNqihwU7KgqwYDTjxJ31qavmYbeDbg== +oas-linter@^3.0.0, oas-linter@^3.1.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/oas-linter/-/oas-linter-3.2.2.tgz#ab6a33736313490659035ca6802dc4b35d48aa1e" + integrity sha512-KEGjPDVoU5K6swgo9hJVA/qYGlwfbFx+Kg2QB/kd7rzV5N8N5Mg6PlsoCMohVnQmo+pzJap/F610qTodKzecGQ== dependencies: + "@exodus/schemasafe" "^1.0.0-rc.2" should "^13.2.1" - yaml "^1.3.1" + yaml "^1.10.0" -oas-resolver@^2.2.4, oas-resolver@^2.2.5: - version "2.2.5" - resolved "https://registry.yarnpkg.com/oas-resolver/-/oas-resolver-2.2.5.tgz#9006e66ee3c0542f3b507ae61afc3e5328d7116c" - integrity sha512-AwARII3hmdXtDAGccvjVsRLked0PNJycIG/koD6lYoGspJjxnQ3a8AmDgp7kHYnG148zusfsl8GM0cfwGmd7EA== +oas-resolver@^2.2.4, oas-resolver@^2.3.0: + version "2.5.6" + resolved "https://registry.yarnpkg.com/oas-resolver/-/oas-resolver-2.5.6.tgz#10430569cb7daca56115c915e611ebc5515c561b" + integrity sha512-Yx5PWQNZomfEhPPOphFbZKi9W93CocQj18NlD2Pa4GWZzdZpSJvYwoiuurRI7m3SpcChrnO08hkuQDL3FGsVFQ== dependencies: node-fetch-h2 "^2.3.0" - oas-kit-common "^1.0.7" - reftools "^1.0.8" - yaml "^1.3.1" - yargs "^12.0.5" + oas-kit-common "^1.0.8" + reftools "^1.1.9" + yaml "^1.10.0" + yargs "^17.0.1" -oas-schema-walker@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/oas-schema-walker/-/oas-schema-walker-1.1.2.tgz#0ad6b78a01421cb9fda9dd820f23f5db51d51b86" - integrity sha512-Q9xqeUtc17ccP/dpUfARci4kwFFszyJAgR/wbDhrRR/73GqsY5uSmKaIK+RmBqO8J4jVYrrDPjQKvt1IcpQdGw== +oas-schema-walker@^1.1.3: + version "1.1.5" + resolved "https://registry.yarnpkg.com/oas-schema-walker/-/oas-schema-walker-1.1.5.tgz#74c3cd47b70ff8e0b19adada14455b5d3ac38a22" + integrity sha512-2yucenq1a9YPmeNExoUa9Qwrt9RFkjqaMAA1X+U7sbb0AqBeTIdMHky9SQQ6iN94bO5NW0W4TRYXerG+BdAvAQ== -oas-validator@^3.0.1, oas-validator@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/oas-validator/-/oas-validator-3.3.1.tgz#4f93207967837fb86efeab86a119fd0342dbd432" - integrity sha512-WFKafxpH2KrxHG6drJiJ7M0mzGZER3XDkLtbeX8z9YNR4JvCMDlhQL7J2i+rnCxyVC8riRZGGeZpxQ0000w2HA== +oas-validator@^3.0.1, oas-validator@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/oas-validator/-/oas-validator-3.4.0.tgz#7633b02e495af4a4e0224b249288b0928748476d" + integrity sha512-l/SxykuACi2U51osSsBXTxdsFc8Fw41xI7AsZkzgVgWJAzoEFaaNptt35WgY9C3757RUclsm6ye5GvSyYoozLQ== dependencies: ajv "^5.5.2" - better-ajv-errors "^0.5.2" + better-ajv-errors "^0.6.7" call-me-maybe "^1.0.1" oas-kit-common "^1.0.7" - oas-linter "^3.0.1" - oas-resolver "^2.2.5" - oas-schema-walker "^1.1.2" - reftools "^1.0.8" + oas-linter "^3.1.0" + oas-resolver "^2.3.0" + oas-schema-walker "^1.1.3" + reftools "^1.1.0" should "^13.2.1" - yaml "^1.3.1" + yaml "^1.8.3" object-assign@^4.1.1: version "4.1.1" @@ -956,9 +996,9 @@ p-is-promise@^2.0.0: integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== p-limit@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" - integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== dependencies: p-try "^2.0.0" @@ -995,21 +1035,21 @@ path-to-regexp@0.1.7: integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= perfect-scrollbar@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/perfect-scrollbar/-/perfect-scrollbar-1.4.0.tgz#5d014ef9775e1f43058a1dbae9ed1daf0e7091f1" - integrity sha512-/2Sk/khljhdrsamjJYS5NjrH+GKEHEwh7zFSiYyxROyYKagkE4kSn2zDQDRTOMo8mpT2jikxx6yI1dG7lNP/hw== + version "1.5.5" + resolved "https://registry.yarnpkg.com/perfect-scrollbar/-/perfect-scrollbar-1.5.5.tgz#41a211a2fb52a7191eff301432134ea47052b27f" + integrity sha512-dzalfutyP3e/FOpdlhVryN4AJ5XDVauVWxybSkLZmakFE2sS3y3pc4JnSprw8tGmHvkaG5Edr5T7LBTZ+WWU2g== polished@^3.0.3: - version "3.4.1" - resolved "https://registry.yarnpkg.com/polished/-/polished-3.4.1.tgz#1eb5597ec1792206365635811d465751f5cbf71c" - integrity sha512-GflTnlP5rrpDoigjczEkS6Ye7NDA4sFvAnlr5hSDrEvjiVj97Xzev3hZlLi3UB27fpxyTS9rWU64VzVLWkG+mg== + version "3.7.2" + resolved "https://registry.yarnpkg.com/polished/-/polished-3.7.2.tgz#ec5ddc17a7d322a574d5e10ddd2a6f01d3e767d1" + integrity sha512-pQKtpZGmsZrW8UUpQMAnR7s3ppHeMQVNyMDKtUyKwuvDmklzcEyM5Kllb3JyE/sE/x7arDmyd35i+4vp99H6sQ== dependencies: - "@babel/runtime" "^7.4.5" + "@babel/runtime" "^7.12.5" prismjs@^1.15.0: - version "1.25.0" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.25.0.tgz#6f822df1bdad965734b310b315a23315cf999756" - integrity sha512-WCjJHl1KEWbnkQom1+SzftbtXMKQoezOCYs5rECqMN+jP+apI7ftoflyqigqzopSO3hMhTEb0mFClA8lkolgEg== + version "1.26.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.26.0.tgz#16881b594828bb6b45296083a8cbab46b0accd47" + integrity sha512-HUoH9C5Z3jKkl3UunCyiD5jwk0+Hz0fIgQ2nbwU2Oo/ceuTAQAg+pPVnfdt2TJWRVLcxKh9iuoYDUSc8clb5UQ== process@^0.11.10: version "0.11.10" @@ -1017,21 +1057,21 @@ process@^0.11.10: integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= prop-types@^15.5.0, prop-types@^15.6.1, prop-types@^15.7.2: - version "15.7.2" - resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" - integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + version "15.8.1" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" + integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== dependencies: loose-envify "^1.4.0" object-assign "^4.1.1" - react-is "^16.8.1" + react-is "^16.13.1" -proxy-addr@~2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.5.tgz#34cbd64a2d81f4b1fd21e76f9f06c8a45299ee34" - integrity sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ== +proxy-addr@~2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" + integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== dependencies: - forwarded "~0.1.2" - ipaddr.js "1.9.0" + forwarded "0.2.0" + ipaddr.js "1.9.1" pump@^3.0.0: version "3.0.0" @@ -1041,37 +1081,37 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" -qs@6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== +qs@6.9.6: + version "6.9.6" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.6.tgz#26ed3c8243a431b2924aca84cc90471f35d5a0ee" + integrity sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ== range-parser@~1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" - integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== +raw-body@2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.2.tgz#baf3e9c21eebced59dd6533ac872b71f7b61cb32" + integrity sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ== dependencies: - bytes "3.1.0" - http-errors "1.7.2" + bytes "3.1.1" + http-errors "1.8.1" iconv-lite "0.4.24" unpipe "1.0.0" react-dropdown@^1.6.4: - version "1.6.4" - resolved "https://registry.yarnpkg.com/react-dropdown/-/react-dropdown-1.6.4.tgz#8dce141bb26fb6b3c3696d16e06f4517728c57f4" - integrity sha512-zTlNRZ6vzjEPsodBNgh6Xjp9IempEx9sReH3crT2Jw4S6KW2wS/BRIH3d/grYf/iXARadDRD91//uUCs9yjoLg== + version "1.9.2" + resolved "https://registry.yarnpkg.com/react-dropdown/-/react-dropdown-1.9.2.tgz#db6cbc90184e3f6dd7eb40f7ddabac4b09dccf15" + integrity sha512-g4eufErTi5P5T5bGK+VmLl//qvAHy79jm6KKx8G2Tl3mG90bpigb+Aw85P+C2JUdAnIIQdv8kP/oHN314GvAfw== dependencies: classnames "^2.2.3" react-hot-loader@^4.8.0: - version "4.12.10" - resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.12.10.tgz#b3457c0f733423c4827c6d2672e50c9f8bedaf6b" - integrity sha512-dX+ZUigxQijWLsKPnxc0khuCt2sYiZ1W59LgSBMOLeGSG3+HkknrTlnJu6BCNdhYxbEQkGvBsr7zXlNWYUIhAQ== + version "4.13.0" + resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.13.0.tgz#c27e9408581c2a678f5316e69c061b226dc6a202" + integrity sha512-JrLlvUPqh6wIkrK2hZDfOyq/Uh/WeVEr8nc7hkn2/3Ul0sx1Kr5y4kOGNacNRoj7RhwLNcQ3Udf1KJXrqc0ZtA== dependencies: fast-levenshtein "^2.0.6" global "^4.3.0" @@ -1082,10 +1122,10 @@ react-hot-loader@^4.8.0: shallowequal "^1.1.0" source-map "^0.7.3" -react-is@^16.7.0, react-is@^16.8.1: - version "16.8.6" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" - integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== +react-is@^16.13.1, react-is@^16.7.0: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== react-lifecycles-compat@^3.0.2, react-lifecycles-compat@^3.0.4: version "3.0.4" @@ -1093,11 +1133,11 @@ react-lifecycles-compat@^3.0.2, react-lifecycles-compat@^3.0.4: integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== react-tabs@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/react-tabs/-/react-tabs-3.0.0.tgz#60311a17c755eb6aa9b3310123e67db421605127" - integrity sha512-z90cDIb+5V7MzjXFHq1VLxYiMH7dDQWan7mXSw6BWQtw+9pYAnq/fEDvsPaXNyevYitvLetdW87C61uu27JVMA== + version "3.2.3" + resolved "https://registry.yarnpkg.com/react-tabs/-/react-tabs-3.2.3.tgz#ccbb3e1241ad3f601047305c75db661239977f2f" + integrity sha512-jx325RhRVnS9DdFbeF511z0T0WEqEoMl1uCE3LoZ6VaZZm7ytatxbum0B8bCTmaiV0KsU+4TtLGTGevCic7SWg== dependencies: - classnames "^2.2.0" + clsx "^1.1.0" prop-types "^15.5.0" redoc@v2.0.0-rc.8-1: @@ -1129,15 +1169,15 @@ redoc@v2.0.0-rc.8-1: swagger2openapi "^5.2.3" tslib "^1.9.3" -reftools@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/reftools/-/reftools-1.0.8.tgz#ec26941f780044420c1d1bb48836112f199e520b" - integrity sha512-hERpM8J+L0q8dzKFh/QqcLlKZYmTgzGZM7m8b1ptS66eg4NA/iMPm7GNw3TKZ876ndVjGpiLt0BCIfAWsUgwGg== +reftools@^1.1.0, reftools@^1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/reftools/-/reftools-1.1.9.tgz#e16e19f662ccd4648605312c06d34e5da3a2b77e" + integrity sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w== -regenerator-runtime@^0.13.2: - version "0.13.3" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz#7cf6a77d8f5c6f60eb73c5fc1955b2ceb01e6bf5" - integrity sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw== +regenerator-runtime@^0.13.4: + version "0.13.9" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" + integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== require-directory@^2.1.1: version "2.1.1" @@ -1149,15 +1189,10 @@ require-main-filename@^1.0.1: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= -safe-buffer@5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-json-stringify@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz#356e44bc98f1f93ce45df14bcd7c01cda86e0afd" - integrity sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg== +safe-buffer@5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== "safer-buffer@>= 2.1.2 < 3": version "2.1.2" @@ -1170,14 +1205,14 @@ secure-keys@^1.0.0: integrity sha1-8MgtmKOxOah3aogIBQuCRDEIf8o= semver@^5.5.0: - version "5.7.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" - integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -send@0.17.1: - version "0.17.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" - integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== +send@0.17.2: + version "0.17.2" + resolved "https://registry.yarnpkg.com/send/-/send-0.17.2.tgz#926622f76601c41808012c8bf1688fe3906f7820" + integrity sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww== dependencies: debug "2.6.9" depd "~1.1.2" @@ -1186,32 +1221,32 @@ send@0.17.1: escape-html "~1.0.3" etag "~1.8.1" fresh "0.5.2" - http-errors "~1.7.2" + http-errors "1.8.1" mime "1.6.0" - ms "2.1.1" + ms "2.1.3" on-finished "~2.3.0" range-parser "~1.2.1" statuses "~1.5.0" -serve-static@1.14.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" - integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== +serve-static@1.14.2: + version "1.14.2" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.2.tgz#722d6294b1d62626d41b43a013ece4598d292bfa" + integrity sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ== dependencies: encodeurl "~1.0.2" escape-html "~1.0.3" parseurl "~1.3.3" - send "0.17.1" + send "0.17.2" set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== shallowequal@^1.1.0: version "1.1.0" @@ -1275,14 +1310,14 @@ should@^13.2.1: should-util "^1.0.0" signal-exit@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== slugify@^1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/slugify/-/slugify-1.3.4.tgz#78d2792d7222b55cd9fc81fa018df99af779efeb" - integrity sha512-KP0ZYk5hJNBS8/eIjGkFDCzGQIoZ1mnfQRYS5WM3273z+fxGWXeN0fkwf2ebEweydv9tioZIHGZKoF21U07/nw== + version "1.6.5" + resolved "https://registry.yarnpkg.com/slugify/-/slugify-1.6.5.tgz#c8f5c072bf2135b80703589b39a3d41451fbe8c8" + integrity sha512-8mo9bslnBO3tr5PEVFzMPIWwWnipGS0xVbYf65zxDqfNwmzYn1LpiKNrR6DlClusuvo+hDHd1zKpmfAe83NQSQ== source-map@^0.7.3: version "0.7.3" @@ -1340,6 +1375,15 @@ string-width@^2.0.0, string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -1354,6 +1398,13 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" @@ -1367,26 +1418,26 @@ supports-color@^5.3.0: has-flag "^3.0.0" swagger2openapi@^5.2.3: - version "5.3.1" - resolved "https://registry.yarnpkg.com/swagger2openapi/-/swagger2openapi-5.3.1.tgz#a60f6ade642c867b13300e1a3c4f265fa5c74685" - integrity sha512-2EIs1gJs9LH4NjrxHPJs6N0Kh9pg66He+H9gIcfn1Q9dvdqPPVTC2NRdXalqT+98rIoV9kSfAtNBD4ASC0Q1mg== + version "5.4.0" + resolved "https://registry.yarnpkg.com/swagger2openapi/-/swagger2openapi-5.4.0.tgz#1e1c8909f7966b1f455bf1b66490093ac1c0029c" + integrity sha512-f5QqfXawiVijhjMtYqWZ55ESHPZFqrPC8L9idhIiuSX8O2qsa1i4MVGtCM3TQF+Smzr/6WfT/7zBuzG3aTgPAA== dependencies: better-ajv-errors "^0.6.1" call-me-maybe "^1.0.1" node-fetch-h2 "^2.3.0" node-readfiles "^0.2.0" oas-kit-common "^1.0.7" - oas-resolver "^2.2.5" - oas-schema-walker "^1.1.2" - oas-validator "^3.3.1" - reftools "^1.0.8" - yaml "^1.3.1" + oas-resolver "^2.3.0" + oas-schema-walker "^1.1.3" + oas-validator "^3.4.0" + reftools "^1.1.0" + yaml "^1.8.3" yargs "^12.0.5" -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== tr46@~0.0.3: version "0.0.3" @@ -1394,11 +1445,11 @@ tr46@~0.0.3: integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= tslib@^1.9.3: - version "1.10.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" - integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -type-is@~1.6.17, type-is@~1.6.18: +type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== @@ -1459,6 +1510,15 @@ wrap-ansi@^2.0.0: string-width "^1.0.1" strip-ansi "^3.0.1" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -1470,16 +1530,19 @@ y18n@^3.2.0: integrity sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ== "y18n@^3.2.1 || ^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" - integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== + version "4.0.3" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" + integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== -yaml@^1.3.1, yaml@^1.5.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.6.0.tgz#d8a985cfb26086dd73f91c637f6e6bc909fddd3c" - integrity sha512-iZfse3lwrJRoSlfs/9KQ9iIXxs9++RvBFVzAqbbBiFT+giYtyanevreF9r61ZTbGMgWQBxAua3FzJiniiJXWWw== - dependencies: - "@babel/runtime" "^7.4.5" +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yaml@^1.10.0, yaml@^1.5.0, yaml@^1.8.3: + version "1.10.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== yargs-parser@^11.1.1: version "11.1.1" @@ -1489,6 +1552,11 @@ yargs-parser@^11.1.1: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.0.tgz#a485d3966be4317426dd56bdb6a30131b281dc55" + integrity sha512-z9kApYUOCwoeZ78rfRYYWdiU/iNL6mwwYlkkZfJoyMR1xps+NEBX5X7XmRpxkZHhXJ6+Ey00IwKxBBSW9FIjyA== + yargs@^12.0.5: version "12.0.5" resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" @@ -1507,6 +1575,19 @@ yargs@^12.0.5: y18n "^3.2.1 || ^4.0.0" yargs-parser "^11.1.1" +yargs@^17.0.1: + version "17.3.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.3.1.tgz#da56b28f32e2fd45aefb402ed9c26f42be4c07b9" + integrity sha512-WUANQeVgjLbNsEmGk20f+nlHgOqzRFpiGWVaBrYGYIGANIIu3lWjoyi0fNlFmJkvfhCZ6BXINe7/W2O2bV4iaA== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.3" + y18n "^5.0.5" + yargs-parser "^21.0.0" + yargs@^3.19.0: version "3.32.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" From 874984d7a0f816e950a16c97f0ce5f7b89d20036 Mon Sep 17 00:00:00 2001 From: James Collins Date: Fri, 8 Oct 2021 15:00:29 +0800 Subject: [PATCH 014/121] Add test to demonstrate OpenAPI v3.0 schema validation fails with empty Path properties --- Makefile | 2 ++ tests/spec/data/empty-maps.json | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tests/spec/data/empty-maps.json diff --git a/Makefile b/Makefile index b26bc5a4..b5de2e92 100644 --- a/Makefile +++ b/Makefile @@ -45,11 +45,13 @@ test: $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) vendor/bin/phpunit --verbose --colors=always $(TESTCASE) $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion.json $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion2.yaml + $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/empty-maps.json lint: install $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/reference/playlist.json $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion.json $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion2.yaml + $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/empty-maps.json $(DOCKER_NODE) yarn run speccy lint tests/spec/data/reference/playlist.json $(DOCKER_NODE) yarn run speccy lint tests/spec/data/recursion.json diff --git a/tests/spec/data/empty-maps.json b/tests/spec/data/empty-maps.json new file mode 100644 index 00000000..51b1eee7 --- /dev/null +++ b/tests/spec/data/empty-maps.json @@ -0,0 +1,22 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "test", + "version": "1.0" + }, + "paths": { + "/products": { + "description": "default", + "get": { + "responses": { + "200": { + "description": "Products", + "headers": {}, + "content": {}, + "links": {} + } + } + } + } + } +} \ No newline at end of file From 331fd7d3dc08b0f01f38717d975df7a8591a54e4 Mon Sep 17 00:00:00 2001 From: James Collins Date: Fri, 8 Oct 2021 15:13:53 +0800 Subject: [PATCH 015/121] During serialization convert empty Map fields to empty Objects Otherwise these fail validation against the OpenAPI v3.0 schema. --- src/SpecBaseObject.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/SpecBaseObject.php b/src/SpecBaseObject.php index 29f70b42..6dbd9488 100644 --- a/src/SpecBaseObject.php +++ b/src/SpecBaseObject.php @@ -191,14 +191,19 @@ public function getSerializableData() $data[$k] = $v->getSerializableData(); } elseif (is_array($v)) { $toObject = false; - $j = 0; - foreach ($v as $i => $d) { - if ($j++ !== $i) { - $toObject = true; - } - if ($d instanceof SpecObjectInterface) { - $data[$k][$i] = $d->getSerializableData(); + if (!empty($v)) { + $j = 0; + foreach ($v as $i => $d) { + if ($j++ !== $i) { + $toObject = true; + } + if ($d instanceof SpecObjectInterface) { + $data[$k][$i] = $d->getSerializableData(); + } } + } elseif (isset($this->attributes()[$k]) && is_array($this->attributes()[$k]) && 2 === count($this->attributes()[$k])) { + // An empty Map, which is an empty array in PHP but needs to be an empty object in output. + $toObject = true; } if ($toObject) { $data[$k] = (object) $data[$k]; From 1bd42dd4800f37924dfb3f41b3b5ac8a83cae251 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 9 Feb 2022 12:20:26 +0100 Subject: [PATCH 016/121] add comments, optimize tests for #125 --- Makefile | 12 ++++++++---- src/SpecBaseObject.php | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b5de2e92..a1810c82 100644 --- a/Makefile +++ b/Makefile @@ -41,11 +41,15 @@ install: composer.lock yarn.lock $(DOCKER_PHP) composer install --prefer-dist --no-interaction --no-progress --ansi $(DOCKER_NODE) yarn install -test: +test: unit test-recursion.json test-recursion2.yaml test-empty-maps.json + +unit: $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) vendor/bin/phpunit --verbose --colors=always $(TESTCASE) - $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion.json - $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/recursion2.yaml - $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/empty-maps.json + +# test specific JSON files in tests/spec/data/ +# e.g. test-recursion will run validation on tests/spec/data/recursion.json +test-%: tests/spec/data/% + $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate $< lint: install $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) bin/php-openapi validate tests/spec/data/reference/playlist.json diff --git a/src/SpecBaseObject.php b/src/SpecBaseObject.php index 6dbd9488..a86324bd 100644 --- a/src/SpecBaseObject.php +++ b/src/SpecBaseObject.php @@ -190,8 +190,11 @@ public function getSerializableData() if ($v instanceof SpecObjectInterface) { $data[$k] = $v->getSerializableData(); } elseif (is_array($v)) { + // test if php arrays should be represented as object in YAML/JSON $toObject = false; if (!empty($v)) { + // case 1: non-empty array should be an object if it does not contain + // consecutive numeric keys $j = 0; foreach ($v as $i => $d) { if ($j++ !== $i) { @@ -202,7 +205,7 @@ public function getSerializableData() } } } elseif (isset($this->attributes()[$k]) && is_array($this->attributes()[$k]) && 2 === count($this->attributes()[$k])) { - // An empty Map, which is an empty array in PHP but needs to be an empty object in output. + // case 2: Attribute type is an object (specified in attributes() by an array which specifies two items (key and value type) $toObject = true; } if ($toObject) { From 0e0c69c4d396aa45b8a7a4f26aa24c33a529f306 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 9 Feb 2022 12:54:26 +0100 Subject: [PATCH 017/121] add hasPropertyValue() method to check if a property has been defined without checking for defaults. fixes #142 --- src/SpecBaseObject.php | 14 ++++++++++++++ src/spec/Schema.php | 2 +- tests/spec/SchemaTest.php | 5 ----- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/SpecBaseObject.php b/src/SpecBaseObject.php index a86324bd..cfdb608d 100644 --- a/src/SpecBaseObject.php +++ b/src/SpecBaseObject.php @@ -305,11 +305,25 @@ protected function addError(string $error, $class = '') $this->_errors[] = end($shortName).$error; } + /** + * @param string $name property name. + * @return bool true when this object has a property with a non-null value or the property is defined in the OpenAPI spec. + * @deprecated since 1.6.0 + */ protected function hasProperty(string $name): bool { return isset($this->_properties[$name]) || isset($this->attributes()[$name]); } + /** + * @param string $name property name. + * @return bool true, when a property has a non-null value (does not check for default values) + */ + protected function hasPropertyValue(string $name): bool + { + return isset($this->_properties[$name]); + } + protected function requireProperties(array $names) { foreach ($names as $name) { diff --git a/src/spec/Schema.php b/src/spec/Schema.php index b8c0709e..c55e2b01 100644 --- a/src/spec/Schema.php +++ b/src/spec/Schema.php @@ -127,7 +127,7 @@ protected function attributeDefaults(): array // nullable is only relevant, when a type is specified // return null as default when there is no type // return false as default when there is a type - 'nullable' => $this->hasProperty('type') ? false : null, + 'nullable' => $this->hasPropertyValue('type') ? false : null, ]; } diff --git a/tests/spec/SchemaTest.php b/tests/spec/SchemaTest.php index 978da349..0e19f74e 100644 --- a/tests/spec/SchemaTest.php +++ b/tests/spec/SchemaTest.php @@ -45,11 +45,6 @@ public function testRead() public function testNullable() { - self::markTestIncomplete( - 'Test currently fails as it was not run when https://github.com/cebe/php-openapi/pull/132 was merged. ' - .'See https://github.com/cebe/php-openapi/issues/142 for status' - ); - /** @var $schema Schema */ $schema = Reader::readFromJson('{"type": "string"}', Schema::class); $this->assertEquals(Type::STRING, $schema->type); From c89d4ac47899da189830f015e98896195d42e1c9 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 9 Feb 2022 12:57:28 +0100 Subject: [PATCH 018/121] more specific deprecation [ci skip] --- src/SpecBaseObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SpecBaseObject.php b/src/SpecBaseObject.php index cfdb608d..aa3367aa 100644 --- a/src/SpecBaseObject.php +++ b/src/SpecBaseObject.php @@ -308,7 +308,7 @@ protected function addError(string $error, $class = '') /** * @param string $name property name. * @return bool true when this object has a property with a non-null value or the property is defined in the OpenAPI spec. - * @deprecated since 1.6.0 + * @deprecated since 1.6.0, will be removed in 2.0.0 */ protected function hasProperty(string $name): bool { From 39b7cac46f79a4b339babacde6187140bd79689a Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 9 Feb 2022 13:17:25 +0100 Subject: [PATCH 019/121] Fixes default value for exclusiveMinimum and exclusiveMaximum fixes #77 --- src/spec/Schema.php | 2 ++ tests/spec/SchemaTest.php | 46 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/src/spec/Schema.php b/src/spec/Schema.php index c55e2b01..6c173795 100644 --- a/src/spec/Schema.php +++ b/src/spec/Schema.php @@ -128,6 +128,8 @@ protected function attributeDefaults(): array // return null as default when there is no type // return false as default when there is a type 'nullable' => $this->hasPropertyValue('type') ? false : null, + 'exclusiveMinimum' => $this->hasPropertyValue('minimum') ? false : null, + 'exclusiveMaximum' => $this->hasPropertyValue('maximum') ? false : null, ]; } diff --git a/tests/spec/SchemaTest.php b/tests/spec/SchemaTest.php index 0e19f74e..1600b3b0 100644 --- a/tests/spec/SchemaTest.php +++ b/tests/spec/SchemaTest.php @@ -66,6 +66,44 @@ public function testNullable() $this->assertNull($schema->nullable); } + public function testMinMax() + { + /** @var $schema Schema */ + $schema = Reader::readFromJson('{"type": "integer"}', Schema::class); + $this->assertNull($schema->minimum); + $this->assertNull($schema->exclusiveMinimum); + $this->assertNull($schema->maximum); + $this->assertNull($schema->exclusiveMaximum); + + /** @var $schema Schema */ + $schema = Reader::readFromJson('{"type": "integer", "minimum": 1}', Schema::class); + $this->assertEquals(1, $schema->minimum); + $this->assertFalse($schema->exclusiveMinimum); + $this->assertNull($schema->maximum); + $this->assertNull($schema->exclusiveMaximum); + + /** @var $schema Schema */ + $schema = Reader::readFromJson('{"type": "integer", "minimum": 1, "exclusiveMinimum": true}', Schema::class); + $this->assertEquals(1, $schema->minimum); + $this->assertTrue($schema->exclusiveMinimum); + $this->assertNull($schema->maximum); + $this->assertNull($schema->exclusiveMaximum); + + /** @var $schema Schema */ + $schema = Reader::readFromJson('{"type": "integer", "maximum": 10}', Schema::class); + $this->assertEquals(10, $schema->maximum); + $this->assertFalse($schema->exclusiveMaximum); + $this->assertNull($schema->minimum); + $this->assertNull($schema->exclusiveMinimum); + + /** @var $schema Schema */ + $schema = Reader::readFromJson('{"type": "integer", "maximum": 10, "exclusiveMaximum": true}', Schema::class); + $this->assertEquals(10, $schema->maximum); + $this->assertTrue($schema->exclusiveMaximum); + $this->assertNull($schema->minimum); + $this->assertNull($schema->exclusiveMinimum); + } + public function testReadObject() { /** @var $schema Schema */ @@ -111,6 +149,10 @@ public function testReadObject() $this->assertFalse($schema->writeOnly); // deprecated Default value is false. $this->assertFalse($schema->deprecated); + // exclusiveMinimum Default value is null when no minimum is specified. + $this->assertNull($schema->exclusiveMinimum); + // exclusiveMaximum Default value is null when no maximum is specified. + $this->assertNull($schema->exclusiveMaximum); } public function testDiscriminator() @@ -267,9 +309,9 @@ public function testSchemaProperties() 'title' => null, 'multipleOf' => null, 'maximum' => null, - 'exclusiveMaximum' => false, + 'exclusiveMaximum' => null, 'minimum' => null, - 'exclusiveMinimum' => false, + 'exclusiveMinimum' => null, 'maxLength' => null, 'minLength' => null, 'pattern' => null, From a02f958b56e29e29cf6d8df52de4fc65e61f1e7d Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 9 Feb 2022 13:36:31 +0100 Subject: [PATCH 020/121] Improve Responses resolving references fixes #119 --- src/spec/Responses.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spec/Responses.php b/src/spec/Responses.php index 52476031..a3623ae4 100644 --- a/src/spec/Responses.php +++ b/src/spec/Responses.php @@ -242,10 +242,10 @@ public function resolveReferences(ReferenceContext $context = null) /** @var Response|Reference|null $referencedObject */ $referencedObject = $response->resolve($context); $this->_responses[$key] = $referencedObject; - if (!$referencedObject instanceof Reference && $referencedObject !== null) { + if (!$referencedObject instanceof Reference && $referencedObject instanceof SpecObjectInterface) { $referencedObject->resolveReferences(); } - } else { + } elseif ($response instanceof SpecObjectInterface) { $response->resolveReferences($context); } } From 43044d59409fb14d89e2a52a13995ae1521423a3 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 9 Feb 2022 14:29:52 +0100 Subject: [PATCH 021/121] Catch recursion when resolving inside included file fixes #144 --- Makefile | 2 +- src/spec/Reference.php | 11 +++++++- tests/spec/data/recursion3_index.yaml | 31 +++++++++++++++++++++ tests/spec/data/recursion3_menu_tree.yaml | 33 +++++++++++++++++++++++ 4 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 tests/spec/data/recursion3_index.yaml create mode 100644 tests/spec/data/recursion3_menu_tree.yaml diff --git a/Makefile b/Makefile index a1810c82..ee99b2ac 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ install: composer.lock yarn.lock $(DOCKER_PHP) composer install --prefer-dist --no-interaction --no-progress --ansi $(DOCKER_NODE) yarn install -test: unit test-recursion.json test-recursion2.yaml test-empty-maps.json +test: unit test-recursion.json test-recursion2.yaml test-recursion3_index.yaml test-empty-maps.json unit: $(DOCKER_PHP) php $(PHPARGS) $(XPHPARGS) vendor/bin/phpunit --verbose --colors=always $(TESTCASE) diff --git a/src/spec/Reference.php b/src/spec/Reference.php index ce99d9ed..cda612a9 100644 --- a/src/spec/Reference.php +++ b/src/spec/Reference.php @@ -289,6 +289,8 @@ private function resolveTransitiveReference(Reference $referencedObject, Referen return $transitiveRefResult; } + private $_recursingInsideFile = false; + /** * Adjust relative references inside of the file to match the context of the base file */ @@ -306,7 +308,14 @@ private function adjustRelativeReferences($referencedDocument, $basePath, $baseD // direcly inline references in the same document, // these are not going to be valid in the new context anymore $inlineDocument = (new JsonPointer(substr($value, 1)))->evaluate($baseDocument); - return $this->adjustRelativeReferences($inlineDocument, $basePath, $baseDocument, $oContext); + if ($this->_recursingInsideFile) { + // keep reference when it is a recursive reference + return ['$ref' => $basePath . $value]; + } + $this->_recursingInsideFile = true; + $return = $this->adjustRelativeReferences($inlineDocument, $basePath, $baseDocument, $oContext); + $this->_recursingInsideFile = false; + return $return; } $referencedDocument[$key] = $context->resolveRelativeUri($value); $parts = explode('#', $referencedDocument[$key], 2); diff --git a/tests/spec/data/recursion3_index.yaml b/tests/spec/data/recursion3_index.yaml new file mode 100644 index 00000000..dff63d62 --- /dev/null +++ b/tests/spec/data/recursion3_index.yaml @@ -0,0 +1,31 @@ +openapi: 3.0.3 +info: + title: Link Example + version: 1.0.0 +#components: +# parameters: +# "Parameter.PetId": +# "$ref": "./subdir/Parameter.PetId.json" +paths: + /contents/menus/{id}/trees: + put: + tags: + - menus + operationId: updateMenuTrees + summary: '123' + description: '456' +# parameters: +# - $ref: '#/components/parameters/PathId' + requestBody: + required: true + content: + application/json: + schema: + $ref: './recursion3_menu_tree.yaml#/UpdateMenuTreesRequest' + responses: + "200": + description: Успешный ответ + content: + application/json: + schema: + $ref: './recursion3_menu_tree.yaml#/UpdateMenuTreesResponse' diff --git a/tests/spec/data/recursion3_menu_tree.yaml b/tests/spec/data/recursion3_menu_tree.yaml new file mode 100644 index 00000000..bce418d4 --- /dev/null +++ b/tests/spec/data/recursion3_menu_tree.yaml @@ -0,0 +1,33 @@ +MenuTree: + type: object + properties: + name: + type: string + description: 'Name' + example: 'Home' + url: + type: string + description: Link + nullable: true + example: '/about/' + children: + type: array + items: + $ref: '#/MenuTree' + example: [] +UpdateMenuTreesRequest: + type: object + properties: + items: + type: array + items: + $ref: '#/MenuTree' +UpdateMenuTreesResponse: + type: object + properties: + data: + type: array + items: + $ref: '#/MenuTree' + required: + - data From 68959399565fa04f9104fed38e3412f6d8620993 Mon Sep 17 00:00:00 2001 From: Csaba Maulis Date: Fri, 3 Sep 2021 16:20:30 +0800 Subject: [PATCH 022/121] Add `ReturnTypeWillChange` attribute Reason: To maintain PHP >=7.1.0 and make implementation PHP 8.1 compatible --- src/json/JsonReference.php | 1 + src/spec/Paths.php | 6 ++++++ src/spec/Responses.php | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/src/json/JsonReference.php b/src/json/JsonReference.php index fe27ced1..cfac559e 100644 --- a/src/json/JsonReference.php +++ b/src/json/JsonReference.php @@ -126,6 +126,7 @@ public function getReference(): string * @return mixed data which can be serialized by json_encode, * which is a value of any type other than a resource. */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return (object)['$ref' => $this->getReference()]; diff --git a/src/spec/Paths.php b/src/spec/Paths.php index a2da8a10..f1ebdc2f 100644 --- a/src/spec/Paths.php +++ b/src/spec/Paths.php @@ -183,6 +183,7 @@ public function getErrors(): array * @return boolean true on success or false on failure. * The return value will be casted to boolean if non-boolean was returned. */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return $this->hasPath($offset); @@ -194,6 +195,7 @@ public function offsetExists($offset) * @param mixed $offset The offset to retrieve. * @return PathItem Can return all value types. */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->getPath($offset); @@ -205,6 +207,7 @@ public function offsetGet($offset) * @param mixed $offset The offset to assign the value to. * @param mixed $value The value to set. */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { $this->addPath($offset, $value); @@ -215,6 +218,7 @@ public function offsetSet($offset, $value) * @link http://php.net/manual/en/arrayaccess.offsetunset.php * @param mixed $offset The offset to unset. */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { $this->removePath($offset); @@ -226,6 +230,7 @@ public function offsetUnset($offset) * @return int The custom count as an integer. * The return value is cast to an integer. */ + #[\ReturnTypeWillChange] public function count() { return count($this->_paths); @@ -236,6 +241,7 @@ public function count() * @link http://php.net/manual/en/iteratoraggregate.getiterator.php * @return Traversable An instance of an object implementing Iterator or Traversable */ + #[\ReturnTypeWillChange] public function getIterator() { return new ArrayIterator($this->_paths); diff --git a/src/spec/Responses.php b/src/spec/Responses.php index a3623ae4..e293fa15 100644 --- a/src/spec/Responses.php +++ b/src/spec/Responses.php @@ -173,6 +173,7 @@ public function getErrors(): array * @return boolean true on success or false on failure. * The return value will be casted to boolean if non-boolean was returned. */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return $this->hasResponse($offset); @@ -184,6 +185,7 @@ public function offsetExists($offset) * @param mixed $offset The offset to retrieve. * @return mixed Can return all value types. */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->getResponse($offset); @@ -195,6 +197,7 @@ public function offsetGet($offset) * @param mixed $offset The offset to assign the value to. * @param mixed $value The value to set. */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { $this->addResponse($offset, $value); @@ -205,6 +208,7 @@ public function offsetSet($offset, $value) * @link http://php.net/manual/en/arrayaccess.offsetunset.php * @param mixed $offset The offset to unset. */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { $this->removeResponse($offset); @@ -216,6 +220,7 @@ public function offsetUnset($offset) * @return int The custom count as an integer. * The return value is cast to an integer. */ + #[\ReturnTypeWillChange] public function count() { return count($this->_responses); @@ -226,6 +231,7 @@ public function count() * @link http://php.net/manual/en/iteratoraggregate.getiterator.php * @return Traversable An instance of an object implementing Iterator or Traversable */ + #[\ReturnTypeWillChange] public function getIterator() { return new ArrayIterator($this->_responses); From 8e592f7dd7997dc2ad62dab1b37275a30efe43d3 Mon Sep 17 00:00:00 2001 From: Csaba Maulis Date: Thu, 10 Feb 2022 05:01:11 +0800 Subject: [PATCH 023/121] Add PHP 8.1 to GitHub test matrix --- .github/workflows/php.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index b60478ab..1cf8b0de 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -19,6 +19,7 @@ jobs: - "7.3" - "7.4" - "8.0" + - "8.1" dependencies: - "lowest" - "highest" @@ -48,6 +49,8 @@ jobs: # symfony/yaml v3.4 is not compatible with PHP 8.0 but has no upper-bound, so it installs on it - php: '8.0' symfony-yaml: '^3.4' + - php: '8.1' + symfony-yaml: '^3.4' runs-on: ${{ matrix.os }} From 8bbbcf1aa3314c535ac315bcd4286ca9cded8a8a Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Thu, 10 Feb 2022 10:44:31 +0100 Subject: [PATCH 024/121] added version annotation --- docker-compose.yml | 1 - src/SpecBaseObject.php | 3 ++- tests/ReaderTest.php | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 67409934..914efb0f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,5 +18,4 @@ services: node: image: node:12 volumes: -# - ./tests/tmp/.composer:/root/.composer:rw - .:/app diff --git a/src/SpecBaseObject.php b/src/SpecBaseObject.php index aa3367aa..1de429bd 100644 --- a/src/SpecBaseObject.php +++ b/src/SpecBaseObject.php @@ -318,6 +318,7 @@ protected function hasProperty(string $name): bool /** * @param string $name property name. * @return bool true, when a property has a non-null value (does not check for default values) + * @since 1.6.0 */ protected function hasPropertyValue(string $name): bool { @@ -511,7 +512,7 @@ public function getDocumentPosition(): ?JsonPointer * Returns extension properties with `x-` prefix. * @see https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#specificationExtensions * @return array - * @since 1.5.3 + * @since 1.6.0 */ public function getExtensions(): array { diff --git a/tests/ReaderTest.php b/tests/ReaderTest.php index 435a8e08..589b7cbb 100644 --- a/tests/ReaderTest.php +++ b/tests/ReaderTest.php @@ -89,6 +89,9 @@ private function assertApiContent(\cebe\openapi\spec\OpenApi $openapi) $this->assertEquals("1.0.0", $openapi->info->version); } + /** + * @see https://github.com/symfony/symfony/issues/34805 + */ public function testSymfonyYamlBugHunt() { $openApiFile = __DIR__ . '/../vendor/oai/openapi-specification/examples/v3.0/uspto.yaml'; From 2224846f00177c3c2c02fab6cebab18b7c005b20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Feb 2022 03:57:02 +0100 Subject: [PATCH 025/121] Bump prismjs from 1.26.0 to 1.27.0 (#154) Bumps [prismjs](https://github.com/PrismJS/prism) from 1.26.0 to 1.27.0. - [Release notes](https://github.com/PrismJS/prism/releases) - [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md) - [Commits](https://github.com/PrismJS/prism/compare/v1.26.0...v1.27.0) --- updated-dependencies: - dependency-name: prismjs dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 309d87b0..a0a66a00 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1047,9 +1047,9 @@ polished@^3.0.3: "@babel/runtime" "^7.12.5" prismjs@^1.15.0: - version "1.26.0" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.26.0.tgz#16881b594828bb6b45296083a8cbab46b0accd47" - integrity sha512-HUoH9C5Z3jKkl3UunCyiD5jwk0+Hz0fIgQ2nbwU2Oo/ceuTAQAg+pPVnfdt2TJWRVLcxKh9iuoYDUSc8clb5UQ== + version "1.27.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.27.0.tgz#bb6ee3138a0b438a3653dd4d6ce0cc6510a45057" + integrity sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA== process@^0.11.10: version "0.11.10" From 2a41063e7eff1d7f4a5d820852c33d4345c5b626 Mon Sep 17 00:00:00 2001 From: Valentin Dorodnov Date: Thu, 17 Mar 2022 10:17:51 +0300 Subject: [PATCH 026/121] Added opportunity for use additional flags for json_encode() function in \cebe\openapi\Writer::writeToJson(). Example JSON_UNESCAPED_UNICODE for non-latin chars. --- src/Writer.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Writer.php b/src/Writer.php index 997a6124..dc1761eb 100644 --- a/src/Writer.php +++ b/src/Writer.php @@ -20,11 +20,12 @@ class Writer /** * Convert OpenAPI spec object to JSON data. * @param SpecObjectInterface|OpenApi $object the OpenApi object instance. + * @param int $flags json_encode() flags * @return string JSON string. */ - public static function writeToJson(SpecObjectInterface $object): string + public static function writeToJson(SpecObjectInterface $object, int $flags = JSON_PRETTY_PRINT): string { - return json_encode($object->getSerializableData(), JSON_PRETTY_PRINT); + return json_encode($object->getSerializableData(), $flags); } /** From 67c63d19e210783900c278dd3c6cf9999e79b1e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 15:09:17 +0200 Subject: [PATCH 027/121] Bump minimist from 1.2.5 to 1.2.6 (#161) Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index a0a66a00..fb2944f1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -801,9 +801,9 @@ min-document@^2.19.0: dom-walk "^0.1.0" minimist@^1.2.0: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== mobx-react@^5.4.3: version "5.4.4" From 2cd5d2da1e824c096c39ba6671ccbe00c3976dbe Mon Sep 17 00:00:00 2001 From: Woody Gilk Date: Fri, 8 Apr 2022 16:04:52 -0500 Subject: [PATCH 028/121] Use new PHPUnit with PHP 8.1 --- .github/workflows/php.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 1cf8b0de..607c866e 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -65,7 +65,11 @@ jobs: tools: composer:v2 - name: Require specific symfony/yaml version - run: "composer require symfony/yaml:'${{ matrix.symfony-yaml }}' --prefer-dist --no-interaction --ansi --no-install" + run: "composer require symfony/yaml:'${{ matrix.symfony-yaml }}' --no-interaction --ansi --no-install" + + - name: Require newer phpunit/phpunit version + run: "composer require phpunit/phpunit '^9.5' --dev --no-interaction --ansi --no-install" + if: matrix.php == '8.1' - name: "Install dependencies with Composer" uses: "ramsey/composer-install@v2" From 495f3efe6524be45c67be5b733c1d082839fc4d5 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 20 Apr 2022 15:41:12 +0200 Subject: [PATCH 029/121] Add PHP 8 compatible return types to Classes implementing PHP internal interfaces - Add return types supported by PHP 7 - Add `#[\ReturnTypeWillChange]` annotation in cases where `mixed` return type is used, which is not available in PHP 7 --- src/json/JsonReference.php | 2 +- src/spec/Paths.php | 17 ++++++----------- src/spec/Responses.php | 17 ++++++----------- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/src/json/JsonReference.php b/src/json/JsonReference.php index cfac559e..5f248881 100644 --- a/src/json/JsonReference.php +++ b/src/json/JsonReference.php @@ -127,7 +127,7 @@ public function getReference(): string * which is a value of any type other than a resource. */ #[\ReturnTypeWillChange] - public function jsonSerialize() + public function jsonSerialize() //: mixed { return (object)['$ref' => $this->getReference()]; } diff --git a/src/spec/Paths.php b/src/spec/Paths.php index f1ebdc2f..e504a90a 100644 --- a/src/spec/Paths.php +++ b/src/spec/Paths.php @@ -183,8 +183,7 @@ public function getErrors(): array * @return boolean true on success or false on failure. * The return value will be casted to boolean if non-boolean was returned. */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return $this->hasPath($offset); } @@ -196,7 +195,7 @@ public function offsetExists($offset) * @return PathItem Can return all value types. */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset) //: mixed { return $this->getPath($offset); } @@ -207,8 +206,7 @@ public function offsetGet($offset) * @param mixed $offset The offset to assign the value to. * @param mixed $value The value to set. */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { $this->addPath($offset, $value); } @@ -218,8 +216,7 @@ public function offsetSet($offset, $value) * @link http://php.net/manual/en/arrayaccess.offsetunset.php * @param mixed $offset The offset to unset. */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { $this->removePath($offset); } @@ -230,8 +227,7 @@ public function offsetUnset($offset) * @return int The custom count as an integer. * The return value is cast to an integer. */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { return count($this->_paths); } @@ -241,8 +237,7 @@ public function count() * @link http://php.net/manual/en/iteratoraggregate.getiterator.php * @return Traversable An instance of an object implementing Iterator or Traversable */ - #[\ReturnTypeWillChange] - public function getIterator() + public function getIterator(): Traversable { return new ArrayIterator($this->_paths); } diff --git a/src/spec/Responses.php b/src/spec/Responses.php index e293fa15..a6db447d 100644 --- a/src/spec/Responses.php +++ b/src/spec/Responses.php @@ -173,8 +173,7 @@ public function getErrors(): array * @return boolean true on success or false on failure. * The return value will be casted to boolean if non-boolean was returned. */ - #[\ReturnTypeWillChange] - public function offsetExists($offset) + public function offsetExists($offset): bool { return $this->hasResponse($offset); } @@ -186,7 +185,7 @@ public function offsetExists($offset) * @return mixed Can return all value types. */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet($offset) //: mixed { return $this->getResponse($offset); } @@ -197,8 +196,7 @@ public function offsetGet($offset) * @param mixed $offset The offset to assign the value to. * @param mixed $value The value to set. */ - #[\ReturnTypeWillChange] - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { $this->addResponse($offset, $value); } @@ -208,8 +206,7 @@ public function offsetSet($offset, $value) * @link http://php.net/manual/en/arrayaccess.offsetunset.php * @param mixed $offset The offset to unset. */ - #[\ReturnTypeWillChange] - public function offsetUnset($offset) + public function offsetUnset($offset): void { $this->removeResponse($offset); } @@ -220,8 +217,7 @@ public function offsetUnset($offset) * @return int The custom count as an integer. * The return value is cast to an integer. */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { return count($this->_responses); } @@ -231,8 +227,7 @@ public function count() * @link http://php.net/manual/en/iteratoraggregate.getiterator.php * @return Traversable An instance of an object implementing Iterator or Traversable */ - #[\ReturnTypeWillChange] - public function getIterator() + public function getIterator(): Traversable { return new ArrayIterator($this->_responses); } From 1c4abf6103fb9ea9aae01515ef1ae7f7f672c614 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 20 Apr 2022 16:22:54 +0200 Subject: [PATCH 030/121] Update src/Writer.php --- src/Writer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Writer.php b/src/Writer.php index dc1761eb..ad29c69e 100644 --- a/src/Writer.php +++ b/src/Writer.php @@ -23,7 +23,7 @@ class Writer * @param int $flags json_encode() flags * @return string JSON string. */ - public static function writeToJson(SpecObjectInterface $object, int $flags = JSON_PRETTY_PRINT): string + public static function writeToJson(SpecObjectInterface $object, int $flags = JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE): string { return json_encode($object->getSerializableData(), $flags); } From e4e00c19800e99ca4a8fbb3516e16b702147e4c7 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 20 Apr 2022 16:40:19 +0200 Subject: [PATCH 031/121] Update src/Writer.php --- src/Writer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Writer.php b/src/Writer.php index ad29c69e..faa08f46 100644 --- a/src/Writer.php +++ b/src/Writer.php @@ -20,7 +20,7 @@ class Writer /** * Convert OpenAPI spec object to JSON data. * @param SpecObjectInterface|OpenApi $object the OpenApi object instance. - * @param int $flags json_encode() flags + * @param int $flags json_encode() flags. Parameter available since version 1.7.0. * @return string JSON string. */ public static function writeToJson(SpecObjectInterface $object, int $flags = JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE): string From 7165770f2bdf187a3a7a7de9024f86a14501d067 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 12:40:01 +0000 Subject: [PATCH 032/121] Bump loader-utils from 1.4.0 to 1.4.2 Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.2. - [Release notes](https://github.com/webpack/loader-utils/releases) - [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md) - [Commits](https://github.com/webpack/loader-utils/compare/v1.4.0...v1.4.2) --- updated-dependencies: - dependency-name: loader-utils dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index fb2944f1..f0ddafc1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -697,9 +697,9 @@ leven@^3.1.0: integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== loader-utils@^1.1.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" - integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== + version "1.4.2" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.2.tgz#29a957f3a63973883eb684f10ffd3d151fec01a3" + integrity sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" @@ -801,9 +801,9 @@ min-document@^2.19.0: dom-walk "^0.1.0" minimist@^1.2.0: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== + version "1.2.7" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" + integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== mobx-react@^5.4.3: version "5.4.4" From d681cccd2cb623c4dbb331774c1386eb9fb65e94 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Dec 2022 20:03:21 +0000 Subject: [PATCH 033/121] Bump express from 4.17.2 to 4.18.2 Bumps [express](https://github.com/expressjs/express) from 4.17.2 to 4.18.2. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.17.2...4.18.2) --- updated-dependencies: - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 267 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 160 insertions(+), 107 deletions(-) diff --git a/yarn.lock b/yarn.lock index fb2944f1..4d236a06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -40,7 +40,7 @@ resolved "https://registry.yarnpkg.com/@exodus/schemasafe/-/schemasafe-1.0.0-rc.6.tgz#7985f681564cff4ffaebb5896eb4be20af3aae7a" integrity sha512-dDnQizD94EdBwEj/fh3zPRa/HWCS9O5au2PuHhZBbuM3xWHxuaKzPBOEWze7Nn0xW68MIpZ7Xdyn1CoCpjKCuQ== -accepts@~1.3.7: +accepts@~1.3.8: version "1.3.8" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== @@ -97,7 +97,7 @@ argparse@^1.0.7: array-flatten@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= + integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== async@^1.4.0: version "1.5.2" @@ -122,26 +122,36 @@ big.js@^5.2.2: resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== -body-parser@1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.1.tgz#1499abbaa9274af3ecc9f6f10396c995943e31d4" - integrity sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA== +body-parser@1.20.1: + version "1.20.1" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" + integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== dependencies: - bytes "3.1.1" + bytes "3.1.2" content-type "~1.0.4" debug "2.6.9" - depd "~1.1.2" - http-errors "1.8.1" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" iconv-lite "0.4.24" - on-finished "~2.3.0" - qs "6.9.6" - raw-body "2.4.2" + on-finished "2.4.1" + qs "6.11.0" + raw-body "2.5.1" type-is "~1.6.18" + unpipe "1.0.0" -bytes@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.1.tgz#3f018291cb4cbad9accb6e6970bca9c8889e879a" - integrity sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg== +bytes@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== + +call-bind@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" call-me-maybe@^1.0.1: version "1.0.1" @@ -263,12 +273,12 @@ content-type@~1.0.4: cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= + integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== -cookie@0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" - integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== +cookie@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" + integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== core-js@^3.2.1: version "3.21.0" @@ -303,15 +313,15 @@ decko@^1.2.0: resolved "https://registry.yarnpkg.com/decko/-/decko-1.2.0.tgz#fd43c735e967b8013306884a56fbe665996b6817" integrity sha1-/UPHNelnuAEzBohKVvvmZZlraBc= -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= +depd@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== -destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= +destroy@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" + integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== dom-walk@^0.1.0: version "0.1.2" @@ -326,7 +336,7 @@ dompurify@^1.0.10: ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== ejs@^2.5.2: version "2.7.4" @@ -346,7 +356,7 @@ emojis-list@^3.0.0: encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== end-of-stream@^1.1.0: version "1.4.4" @@ -368,7 +378,7 @@ escalade@^3.1.1: escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== escape-string-regexp@^1.0.5: version "1.0.5" @@ -383,7 +393,7 @@ esprima@^4.0.0: etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= + integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== eventemitter3@^3.0.0: version "3.1.2" @@ -404,37 +414,38 @@ execa@^1.0.0: strip-eof "^1.0.0" express@^4.14.0: - version "4.17.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.17.2.tgz#c18369f265297319beed4e5558753cc8c1364cb3" - integrity sha512-oxlxJxcQlYwqPWKVJJtvQiwHgosH/LrLSPA+H4UxpyvSS6jC5aH+5MoHFM+KABgTOt0APue4w66Ha8jCUo9QGg== + version "4.18.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" + integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== dependencies: - accepts "~1.3.7" + accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.19.1" + body-parser "1.20.1" content-disposition "0.5.4" content-type "~1.0.4" - cookie "0.4.1" + cookie "0.5.0" cookie-signature "1.0.6" debug "2.6.9" - depd "~1.1.2" + depd "2.0.0" encodeurl "~1.0.2" escape-html "~1.0.3" etag "~1.8.1" - finalhandler "~1.1.2" + finalhandler "1.2.0" fresh "0.5.2" + http-errors "2.0.0" merge-descriptors "1.0.1" methods "~1.1.2" - on-finished "~2.3.0" + on-finished "2.4.1" parseurl "~1.3.3" path-to-regexp "0.1.7" proxy-addr "~2.0.7" - qs "6.9.6" + qs "6.11.0" range-parser "~1.2.1" safe-buffer "5.2.1" - send "0.17.2" - serve-static "1.14.2" + send "0.18.0" + serve-static "1.15.0" setprototypeof "1.2.0" - statuses "~1.5.0" + statuses "2.0.1" type-is "~1.6.18" utils-merge "1.0.1" vary "~1.1.2" @@ -459,17 +470,17 @@ fast-safe-stringify@^2.0.7: resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== -finalhandler@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" - integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== +finalhandler@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" + integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== dependencies: debug "2.6.9" encodeurl "~1.0.2" escape-html "~1.0.3" - on-finished "~2.3.0" + on-finished "2.4.1" parseurl "~1.3.3" - statuses "~1.5.0" + statuses "2.0.1" unpipe "~1.0.0" find-up@^3.0.0: @@ -497,7 +508,12 @@ forwarded@0.2.0: fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= + integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== get-caller-file@^1.0.1: version "1.0.3" @@ -509,6 +525,15 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-intrinsic@^1.0.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385" + integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.3" + get-stream@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -534,6 +559,18 @@ has-flag@^3.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= +has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.3.0: version "3.3.2" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" @@ -541,15 +578,15 @@ hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.3.0: dependencies: react-is "^16.7.0" -http-errors@1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c" - integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g== +http-errors@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" + integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== dependencies: - depd "~1.1.2" + depd "2.0.0" inherits "2.0.4" setprototypeof "1.2.0" - statuses ">= 1.5.0 < 2" + statuses "2.0.1" toidentifier "1.0.1" http2-client@^1.2.5: @@ -745,7 +782,7 @@ marked@^0.6.1: media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== mem@^4.0.0: version "4.3.0" @@ -764,24 +801,24 @@ memoize-one@^5.0.0: merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= + integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= + integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== -mime-db@1.51.0: - version "1.51.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== mime-types@~2.1.24, mime-types@~2.1.34: - version "2.1.34" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: - mime-db "1.51.0" + mime-db "1.52.0" mime@1.6.0: version "1.6.0" @@ -816,7 +853,7 @@ mobx-react@^5.4.3: ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== ms@2.1.3: version "2.1.3" @@ -936,10 +973,15 @@ object-assign@^4.1.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= +object-inspect@^1.9.0: + version "1.12.2" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" + integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== + +on-finished@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" + integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== dependencies: ee-first "1.1.1" @@ -1032,7 +1074,7 @@ path-key@^2.0.0, path-key@^2.0.1: path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= + integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== perfect-scrollbar@^1.4.0: version "1.5.5" @@ -1081,23 +1123,25 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" -qs@6.9.6: - version "6.9.6" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.6.tgz#26ed3c8243a431b2924aca84cc90471f35d5a0ee" - integrity sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ== +qs@6.11.0: + version "6.11.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" + integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== + dependencies: + side-channel "^1.0.4" range-parser@~1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.2.tgz#baf3e9c21eebced59dd6533ac872b71f7b61cb32" - integrity sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ== +raw-body@2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" + integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== dependencies: - bytes "3.1.1" - http-errors "1.8.1" + bytes "3.1.2" + http-errors "2.0.0" iconv-lite "0.4.24" unpipe "1.0.0" @@ -1209,34 +1253,34 @@ semver@^5.5.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -send@0.17.2: - version "0.17.2" - resolved "https://registry.yarnpkg.com/send/-/send-0.17.2.tgz#926622f76601c41808012c8bf1688fe3906f7820" - integrity sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww== +send@0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" + integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== dependencies: debug "2.6.9" - depd "~1.1.2" - destroy "~1.0.4" + depd "2.0.0" + destroy "1.2.0" encodeurl "~1.0.2" escape-html "~1.0.3" etag "~1.8.1" fresh "0.5.2" - http-errors "1.8.1" + http-errors "2.0.0" mime "1.6.0" ms "2.1.3" - on-finished "~2.3.0" + on-finished "2.4.1" range-parser "~1.2.1" - statuses "~1.5.0" + statuses "2.0.1" -serve-static@1.14.2: - version "1.14.2" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.2.tgz#722d6294b1d62626d41b43a013ece4598d292bfa" - integrity sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ== +serve-static@1.15.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" + integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== dependencies: encodeurl "~1.0.2" escape-html "~1.0.3" parseurl "~1.3.3" - send "0.17.2" + send "0.18.0" set-blocking@^2.0.0: version "2.0.0" @@ -1309,6 +1353,15 @@ should@^13.2.1: should-type-adaptors "^1.0.1" should-util "^1.0.0" +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + signal-exit@^3.0.0: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" @@ -1348,10 +1401,10 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= -"statuses@>= 1.5.0 < 2", statuses@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= +statuses@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" + integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== stickyfill@^1.1.1: version "1.1.1" @@ -1460,17 +1513,17 @@ type-is@~1.6.18: unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== utils-merge@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== vary@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== webidl-conversions@^3.0.0: version "3.0.1" From 35f1f376dc80473eb4663abd385656e8cb79d589 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Dec 2022 17:27:54 +0000 Subject: [PATCH 034/121] Bump json-pointer from 0.6.1 to 0.6.2 Bumps [json-pointer](https://github.com/manuelstofer/json-pointer) from 0.6.1 to 0.6.2. - [Release notes](https://github.com/manuelstofer/json-pointer/releases) - [Commits](https://github.com/manuelstofer/json-pointer/commits) --- updated-dependencies: - dependency-name: json-pointer dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index fb2944f1..85baa02f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -480,9 +480,9 @@ find-up@^3.0.0: locate-path "^3.0.0" foreach@^2.0.4: - version "2.0.5" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" - integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= + version "2.0.6" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.6.tgz#87bcc8a1a0e74000ff2bf9802110708cfb02eb6e" + integrity sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg== format-util@^1.0.3: version "1.0.5" @@ -630,9 +630,9 @@ js-yaml@^3.12.1, js-yaml@^3.2.3: esprima "^4.0.0" json-pointer@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/json-pointer/-/json-pointer-0.6.1.tgz#3c6caa6ac139e2599f5a1659d39852154015054d" - integrity sha512-3OvjqKdCBvH41DLpV4iSt6v2XhZXV1bPB4OROuknvUXI7ZQNofieCPkmE26stEJ9zdQuvIxDHCuYhfgxFAAs+Q== + version "0.6.2" + resolved "https://registry.yarnpkg.com/json-pointer/-/json-pointer-0.6.2.tgz#f97bd7550be5e9ea901f8c9264c9d436a22a93cd" + integrity sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw== dependencies: foreach "^2.0.4" From 9969ac174d62b80c1e9fc25b3d99a96248a45250 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 7 Jan 2023 06:35:56 +0000 Subject: [PATCH 035/121] Bump json5 from 1.0.1 to 1.0.2 Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2. - [Release notes](https://github.com/json5/json5/releases) - [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md) - [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2) --- updated-dependencies: - dependency-name: json5 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index fb2944f1..ee381ed0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -666,9 +666,9 @@ json-to-ast@^2.0.3: grapheme-splitter "^1.0.4" json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== dependencies: minimist "^1.2.0" @@ -801,9 +801,9 @@ min-document@^2.19.0: dom-walk "^0.1.0" minimist@^1.2.0: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== + version "1.2.7" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" + integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== mobx-react@^5.4.3: version "5.4.4" From 7bb9f59619e00a892fec4d78ebaa1a16f7a56bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roger=20Vil=C3=A0?= Date: Fri, 27 Jan 2023 11:39:22 +0100 Subject: [PATCH 036/121] phpstan 1.x support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roger Vilà --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 46cb26f2..8162284c 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "mermade/openapi3-examples": "1.0.0", "apis-guru/openapi-directory": "1.0.0", "nexmo/api-specification": "1.0.0", - "phpstan/phpstan": "^0.12.0" + "phpstan/phpstan": "^0.12.0 || ^1.9" }, "conflict": { "symfony/yaml": "3.4.0 - 3.4.4 || 4.0.0 - 4.4.17 || 5.0.0 - 5.1.9 || 5.2.0" From 786230beac40d7c73421ec59b23ce01144cd2dec Mon Sep 17 00:00:00 2001 From: Andrew Potter Date: Sat, 24 Jun 2023 19:34:17 +0200 Subject: [PATCH 037/121] Update README.md A new project which makes use of php-openapi --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3d25df05..55d9dbd3 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ do awesome work: - [cebe/yii2-app-api](https://github.com/cebe/yii2-app-api) Yii framework application template for developing API-first applications. - [league/openapi-psr7-validator](https://github.com/thephpleague/openapi-psr7-validator) validates PSR-7 messages (HTTP request/response) against OpenAPI descriptions. - [dsuurlant/response2schema](https://github.com/dsuurlant/response2schema) a quick and easy tool for generating OpenAPI schemas based on example data. +- [googoogajoob/openapislim4](https://github.com/googoogajoob/openapislim4) Configure the paths of a slim4 application from an openapi definition. - ... ([add yours](https://github.com/cebe/php-openapi/edit/master/README.md#L24)) ## Usage From 2aecd528dccd6dcfa897f5f1793c196c8e6dff4a Mon Sep 17 00:00:00 2001 From: Andrew Potter Date: Tue, 27 Jun 2023 18:45:09 +0200 Subject: [PATCH 038/121] Update README.md Fix repository name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 55d9dbd3..e54b9452 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ do awesome work: - [cebe/yii2-app-api](https://github.com/cebe/yii2-app-api) Yii framework application template for developing API-first applications. - [league/openapi-psr7-validator](https://github.com/thephpleague/openapi-psr7-validator) validates PSR-7 messages (HTTP request/response) against OpenAPI descriptions. - [dsuurlant/response2schema](https://github.com/dsuurlant/response2schema) a quick and easy tool for generating OpenAPI schemas based on example data. -- [googoogajoob/openapislim4](https://github.com/googoogajoob/openapislim4) Configure the paths of a slim4 application from an openapi definition. +- [googoogajoob/openapi-slim4](https://github.com/googoogajoob/openapi-slim4) Configure the paths of a slim4 application from an openapi definition. - ... ([add yours](https://github.com/cebe/php-openapi/edit/master/README.md#L24)) ## Usage From c843243488dd31e32100444161e6b2e2321c5325 Mon Sep 17 00:00:00 2001 From: Arinzechukwu Date: Wed, 13 Sep 2023 15:50:58 +0100 Subject: [PATCH 039/121] Added test to confirm referenced parameters are compiling to arrays --- tests/spec/PathTest.php | 31 ++++++++++ tests/spec/data/path-params/global.yaml | 28 +++++++++ tests/spec/data/path-params/openapi.yaml | 18 ++++++ tests/spec/data/path-params/user.yaml | 76 ++++++++++++++++++++++++ 4 files changed, 153 insertions(+) create mode 100644 tests/spec/data/path-params/global.yaml create mode 100644 tests/spec/data/path-params/openapi.yaml create mode 100644 tests/spec/data/path-params/user.yaml diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 6c46e4b0..e5be1bfd 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -192,4 +192,35 @@ public function testPathItemReference() $this->assertEquals('A bar', $barPath->get->responses['200']->description); $this->assertEquals('non-existing resource', $barPath->get->responses['404']->description); } + + public function testPathParametersAreArrays() + { + $file = __DIR__ . '/data/path-params/openapi.yaml'; + /** @var $openapi \cebe\openapi\spec\OpenApi */ + $openapi = Reader::readFromYamlFile($file, \cebe\openapi\spec\OpenApi::class, true); + + $result = $openapi->validate(); + $this->assertEquals([], $openapi->getErrors(), print_r($openapi->getErrors(), true)); + $this->assertTrue($result); + + $this->assertInstanceOf(Paths::class, $openapi->paths); + $this->assertIsArray($openapi->paths->getPaths()); + $this->assertInstanceOf(PathItem::class, $usersPath = $openapi->paths['/v1/{organizationId}/user']); + $this->assertInstanceOf(PathItem::class, $userIdPath = $openapi->paths['/v1/{organizationId}/user/{id}']); + + $result = $usersPath->validate(); + $this->assertTrue($result); + $this->assertIsArray($usersPath->parameters); + $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $usersPath->parameters[0]); + $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $usersPath->parameters[1]); + $this->assertEquals($usersPath->parameters[0]->name, 'api-version'); + + $result = $userIdPath->validate(); + $this->assertTrue($result); + $this->assertIsArray($userIdPath->parameters); + $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[0]); + $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); + $this->assertEquals($userIdPath->parameters[2]->name, 'id'); + + } } diff --git a/tests/spec/data/path-params/global.yaml b/tests/spec/data/path-params/global.yaml new file mode 100644 index 00000000..38348ee4 --- /dev/null +++ b/tests/spec/data/path-params/global.yaml @@ -0,0 +1,28 @@ +components: + parameters: + Version: + in: header + name: api-version + required: false + schema: + type: string + format: date + example: '2021-05-18' + description: The API version + OrganizationId: + in: path + name: organizationId + required: true + schema: + type: string + format: uuid + description: The Organization ID + responses: + BadRequest: + description: Bad Request + Forbidden: + description: Forbidden + NotFound: + description: Not Found + Success: + description: Success \ No newline at end of file diff --git a/tests/spec/data/path-params/openapi.yaml b/tests/spec/data/path-params/openapi.yaml new file mode 100644 index 00000000..722d8184 --- /dev/null +++ b/tests/spec/data/path-params/openapi.yaml @@ -0,0 +1,18 @@ +openapi: 3.0.0 +info: + version: "2021-05-18" + title: Test REST API + description: Specifications for the Test REST API. + contact: + name: bplainia + email: bplainia@lhespotlight.org + +servers: + - url: 'http://localhost:8000' + description: 'Test' + +paths: + /v1/{organizationId}/user: + $ref: 'user.yaml#/paths/Users' + /v1/{organizationId}/user/{id}: + $ref: 'user.yaml#/paths/UserId' \ No newline at end of file diff --git a/tests/spec/data/path-params/user.yaml b/tests/spec/data/path-params/user.yaml new file mode 100644 index 00000000..a842e783 --- /dev/null +++ b/tests/spec/data/path-params/user.yaml @@ -0,0 +1,76 @@ +paths: + Users: + parameters: + - $ref: 'global.yaml#/components/parameters/Version' + - $ref: 'global.yaml#/components/parameters/OrganizationId' + post: + summary: Creates a user + security: + - BearerAuth: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/User' + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/User' + '400': + $ref: 'global.yaml#/components/responses/BadRequest' + '403': + $ref: 'global.yaml#/components/responses/Forbidden' + UserId: + parameters: + - $ref: 'global.yaml#/components/parameters/Version' + - $ref: 'global.yaml#/components/parameters/OrganizationId' + - $ref: '#/components/parameters/UserId' + get: + summary: Gets a user + security: + - BearerAuth: [] + responses: + '200': + description: A bar + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/User' + '400': + $ref: 'global.yaml#/components/responses/BadRequest' + '403': + $ref: 'global.yaml#/components/responses/Forbidden' + '404': + $ref: 'global.yaml#/components/responses/NotFound' +components: + schemas: + User: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + parameters: + UserId: + in: path + name: id + required: true + schema: + type: string + format: uuid + description: User's ID \ No newline at end of file From 2e2bce1ddf7c4cd9f51437aa682a8d7c4e3d2a93 Mon Sep 17 00:00:00 2001 From: Peter Stalman Date: Fri, 22 Sep 2023 04:07:14 -0700 Subject: [PATCH 040/121] Update README.md (add Spectator) Not mine, but it has ~250 stars so worth adding. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3d25df05..8286d213 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ do awesome work: - [cebe/yii2-app-api](https://github.com/cebe/yii2-app-api) Yii framework application template for developing API-first applications. - [league/openapi-psr7-validator](https://github.com/thephpleague/openapi-psr7-validator) validates PSR-7 messages (HTTP request/response) against OpenAPI descriptions. - [dsuurlant/response2schema](https://github.com/dsuurlant/response2schema) a quick and easy tool for generating OpenAPI schemas based on example data. +- [hotmeteor/spectator](https://github.com/hotmeteor/spectator) a light-weight OpenAPI testing tool for existing Laravel test suite. - ... ([add yours](https://github.com/cebe/php-openapi/edit/master/README.md#L24)) ## Usage From f10a528e516a1371a3e5f43c6663196c24285037 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 13 Nov 2024 16:51:30 +0100 Subject: [PATCH 041/121] restore missing tag in apis-guru/openapi-directory --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 46cb26f2..567c1487 100644 --- a/composer.json +++ b/composer.json @@ -81,7 +81,7 @@ "source": { "url": "https://github.com/APIs-guru/openapi-directory", "type": "git", - "reference": "openapi3.0.0" + "reference": "9d2e0b6696a230a182d740a8e97ba27fb41b13bd" } } }, From ae184f30789879f7820640a9d0eff73f4480d984 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 13 Nov 2024 17:13:16 +0100 Subject: [PATCH 042/121] replace missing repo with a fork --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 567c1487..c66df1b4 100644 --- a/composer.json +++ b/composer.json @@ -91,9 +91,9 @@ "name": "nexmo/api-specification", "version": "1.0.0", "source": { - "url": "https://github.com/Nexmo/api-specification", + "url": "https://github.com/cebe/nexmo-api-specification", "type": "git", - "reference": "voice-2.0.0" + "reference": "590fadf21f528ed8e05f6ff47c2e49d81f50a181" } } } From 11e829729f76afb96c0a263fb72c004703642c64 Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Mon, 5 Feb 2024 09:56:45 -0500 Subject: [PATCH 043/121] Allow Symfony 7 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c66df1b4..a3054a52 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "require": { "php": ">=7.1.0", "ext-json": "*", - "symfony/yaml": "^3.4 || ^4 || ^5 || ^6", + "symfony/yaml": "^3.4 || ^4 || ^5 || ^6 || ^7.0", "justinrainbow/json-schema": "^5.2" }, "require-dev": { From a26aa37192ea70db57bd4941ebbaba444d255bae Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 13 Nov 2024 17:18:56 +0100 Subject: [PATCH 044/121] run tests with symfony 7 --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 607c866e..85cc0eda 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -23,7 +23,7 @@ jobs: dependencies: - "lowest" - "highest" - symfony-yaml: ['^3.4', '^4', '^5', '^6'] + symfony-yaml: ['^3.4', '^4', '^5', '^6', '^7'] include: - os: "windows-latest" php: "8.0" From 3bbcdb99eeabccc8253a1c52e9da177ba8fb9859 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 13 Nov 2024 17:31:52 +0100 Subject: [PATCH 045/121] remove very old systems from test matrix --- .github/workflows/php.yml | 40 ++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 85cc0eda..de4bd6d7 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -14,16 +14,19 @@ jobs: matrix: os: [ubuntu-latest] php: - - "7.1" - - "7.2" - - "7.3" + #- "7.1" + #- "7.2" + #- "7.3" - "7.4" - "8.0" - "8.1" + - "8.2" + - "8.3" dependencies: - "lowest" - "highest" - symfony-yaml: ['^3.4', '^4', '^5', '^6', '^7'] + #symfony-yaml: ['^3.4', '^4', '^5', '^6', '^7'] + symfony-yaml: ['^5', '^6', '^7'] include: - os: "windows-latest" php: "8.0" @@ -35,22 +38,29 @@ jobs: symfony-yaml: '^5' exclude: # symfony/yaml v5 does not run on PHP 7.1 - - php: '7.1' - symfony-yaml: '^5' + #- php: '7.1' + # symfony-yaml: '^5' # symfony/yaml v6 does not run on PHP 7.* - - php: '7.1' - symfony-yaml: '^6' - - php: '7.2' - symfony-yaml: '^6' - - php: '7.3' - symfony-yaml: '^6' + #- php: '7.1' + # symfony-yaml: '^6' + #- php: '7.2' + # symfony-yaml: '^6' + #- php: '7.3' + # symfony-yaml: '^6' - php: '7.4' symfony-yaml: '^6' - # symfony/yaml v3.4 is not compatible with PHP 8.0 but has no upper-bound, so it installs on it + # symfony/yaml v7 does not run on PHP <8.2 + - php: '7.4' + symfony-yaml: '^7' - php: '8.0' - symfony-yaml: '^3.4' + symfony-yaml: '^7' - php: '8.1' - symfony-yaml: '^3.4' + symfony-yaml: '^7' + # symfony/yaml v3.4 is not compatible with PHP 8.0 but has no upper-bound, so it installs on it + #- php: '8.0' + # symfony-yaml: '^3.4' + #- php: '8.1' + # symfony-yaml: '^3.4' runs-on: ${{ matrix.os }} From 2ebe61852ed729d1bb632b8591f516c6bb7416f5 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Thu, 14 Nov 2024 21:58:08 +0100 Subject: [PATCH 046/121] use newer phpunit version on php 8.2 and 8.3 --- .github/workflows/php.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index de4bd6d7..add9b3d7 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -79,7 +79,7 @@ jobs: - name: Require newer phpunit/phpunit version run: "composer require phpunit/phpunit '^9.5' --dev --no-interaction --ansi --no-install" - if: matrix.php == '8.1' + if: matrix.php == '8.1' || matrix.php == '8.2' || matrix.php == '8.3' - name: "Install dependencies with Composer" uses: "ramsey/composer-install@v2" From f47247a204cadde298ec7e0b821ab3349d724199 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Thu, 14 Nov 2024 22:54:20 +0100 Subject: [PATCH 047/121] fix make install target composer.lock and yarn.lock are not in git so make can not require them fixes #207 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ee99b2ac..acfca9e2 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ fix-style: php-cs-fixer.phar $(DOCKER_PHP) vendor/bin/indent --spaces .php_cs.dist $(DOCKER_PHP) ./php-cs-fixer.phar fix src/ --diff -install: composer.lock yarn.lock +install: $(DOCKER_PHP) composer install --prefer-dist --no-interaction --no-progress --ansi $(DOCKER_NODE) yarn install From 1779bccde8b124e911e9a91f29c679dce0809ba2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 22:06:49 +0000 Subject: [PATCH 048/121] Bump express from 4.18.2 to 4.21.1 Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.21.1. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/4.21.1/History.md) - [Commits](https://github.com/expressjs/express/compare/4.18.2...4.21.1) --- updated-dependencies: - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 242 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 155 insertions(+), 87 deletions(-) diff --git a/yarn.lock b/yarn.lock index 259f5870..2a4c5d53 100644 --- a/yarn.lock +++ b/yarn.lock @@ -122,21 +122,21 @@ big.js@^5.2.2: resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== -body-parser@1.20.1: - version "1.20.1" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" - integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== +body-parser@1.20.3: + version "1.20.3" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.3.tgz#1953431221c6fb5cd63c4b36d53fab0928e548c6" + integrity sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g== dependencies: bytes "3.1.2" - content-type "~1.0.4" + content-type "~1.0.5" debug "2.6.9" depd "2.0.0" destroy "1.2.0" http-errors "2.0.0" iconv-lite "0.4.24" on-finished "2.4.1" - qs "6.11.0" - raw-body "2.5.1" + qs "6.13.0" + raw-body "2.5.2" type-is "~1.6.18" unpipe "1.0.0" @@ -145,13 +145,16 @@ bytes@3.1.2: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== -call-bind@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== +call-bind@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.7.tgz#06016599c40c56498c18769d2730be242b6fa3b9" + integrity sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w== dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" + es-define-property "^1.0.0" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + set-function-length "^1.2.1" call-me-maybe@^1.0.1: version "1.0.1" @@ -270,15 +273,20 @@ content-type@~1.0.4: resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== +content-type@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" + integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== + cookie-signature@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== -cookie@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" - integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== +cookie@0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.1.tgz#2f73c42142d5d5cf71310a74fc4ae61670e5dbc9" + integrity sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w== core-js@^3.2.1: version "3.21.0" @@ -313,6 +321,15 @@ decko@^1.2.0: resolved "https://registry.yarnpkg.com/decko/-/decko-1.2.0.tgz#fd43c735e967b8013306884a56fbe665996b6817" integrity sha1-/UPHNelnuAEzBohKVvvmZZlraBc= +define-data-property@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" + integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + gopd "^1.0.1" + depd@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" @@ -358,6 +375,11 @@ encodeurl@~1.0.2: resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== +encodeurl@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58" + integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg== + end-of-stream@^1.1.0: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" @@ -365,6 +387,18 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" +es-define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.0.tgz#c7faefbdff8b2696cf5f46921edfb77cc4ba3845" + integrity sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ== + dependencies: + get-intrinsic "^1.2.4" + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + es6-promise@^3.2.1: version "3.3.1" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" @@ -414,36 +448,36 @@ execa@^1.0.0: strip-eof "^1.0.0" express@^4.14.0: - version "4.18.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" - integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== + version "4.21.1" + resolved "https://registry.yarnpkg.com/express/-/express-4.21.1.tgz#9dae5dda832f16b4eec941a4e44aa89ec481b281" + integrity sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ== dependencies: accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.20.1" + body-parser "1.20.3" content-disposition "0.5.4" content-type "~1.0.4" - cookie "0.5.0" + cookie "0.7.1" cookie-signature "1.0.6" debug "2.6.9" depd "2.0.0" - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" etag "~1.8.1" - finalhandler "1.2.0" + finalhandler "1.3.1" fresh "0.5.2" http-errors "2.0.0" - merge-descriptors "1.0.1" + merge-descriptors "1.0.3" methods "~1.1.2" on-finished "2.4.1" parseurl "~1.3.3" - path-to-regexp "0.1.7" + path-to-regexp "0.1.10" proxy-addr "~2.0.7" - qs "6.11.0" + qs "6.13.0" range-parser "~1.2.1" safe-buffer "5.2.1" - send "0.18.0" - serve-static "1.15.0" + send "0.19.0" + serve-static "1.16.2" setprototypeof "1.2.0" statuses "2.0.1" type-is "~1.6.18" @@ -470,13 +504,13 @@ fast-safe-stringify@^2.0.7: resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== -finalhandler@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" - integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== +finalhandler@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.3.1.tgz#0c575f1d1d324ddd1da35ad7ece3df7d19088019" + integrity sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ== dependencies: debug "2.6.9" - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" on-finished "2.4.1" parseurl "~1.3.3" @@ -510,10 +544,10 @@ fresh@0.5.2: resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== get-caller-file@^1.0.1: version "1.0.3" @@ -525,14 +559,16 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385" - integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A== +get-intrinsic@^1.1.3, get-intrinsic@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.4.tgz#e385f5a4b5227d449c3eabbad05494ef0abbeadd" + integrity sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ== dependencies: - function-bind "^1.1.1" - has "^1.0.3" + es-errors "^1.3.0" + function-bind "^1.1.2" + has-proto "^1.0.1" has-symbols "^1.0.3" + hasown "^2.0.0" get-stream@^4.0.0: version "4.1.0" @@ -549,6 +585,13 @@ global@^4.3.0: min-document "^2.19.0" process "^0.11.10" +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + grapheme-splitter@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" @@ -559,17 +602,29 @@ has-flag@^3.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= +has-property-descriptors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" + integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== + dependencies: + es-define-property "^1.0.0" + +has-proto@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd" + integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== + has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== +hasown@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== dependencies: - function-bind "^1.1.1" + function-bind "^1.1.2" hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.3.0: version "3.3.2" @@ -798,10 +853,10 @@ memoize-one@^5.0.0: resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.2.1.tgz#8337aa3c4335581839ec01c3d594090cebe8f00e" integrity sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q== -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== +merge-descriptors@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.3.tgz#d80319a65f3c7935351e5cfdac8f9318504dbed5" + integrity sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ== methods@~1.1.2: version "1.1.2" @@ -973,10 +1028,10 @@ object-assign@^4.1.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -object-inspect@^1.9.0: - version "1.12.2" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" - integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== +object-inspect@^1.13.1: + version "1.13.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.3.tgz#f14c183de51130243d6d18ae149375ff50ea488a" + integrity sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA== on-finished@2.4.1: version "2.4.1" @@ -1071,10 +1126,10 @@ path-key@^2.0.0, path-key@^2.0.1: resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== +path-to-regexp@0.1.10: + version "0.1.10" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b" + integrity sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w== perfect-scrollbar@^1.4.0: version "1.5.5" @@ -1123,22 +1178,22 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" -qs@6.11.0: - version "6.11.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" - integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== +qs@6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.13.0.tgz#6ca3bd58439f7e245655798997787b0d88a51906" + integrity sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg== dependencies: - side-channel "^1.0.4" + side-channel "^1.0.6" range-parser@~1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" - integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== +raw-body@2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== dependencies: bytes "3.1.2" http-errors "2.0.0" @@ -1253,10 +1308,10 @@ semver@^5.5.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -send@0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" - integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== +send@0.19.0: + version "0.19.0" + resolved "https://registry.yarnpkg.com/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8" + integrity sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw== dependencies: debug "2.6.9" depd "2.0.0" @@ -1272,21 +1327,33 @@ send@0.18.0: range-parser "~1.2.1" statuses "2.0.1" -serve-static@1.15.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" - integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== +serve-static@1.16.2: + version "1.16.2" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.16.2.tgz#b6a5343da47f6bdd2673848bf45754941e803296" + integrity sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw== dependencies: - encodeurl "~1.0.2" + encodeurl "~2.0.0" escape-html "~1.0.3" parseurl "~1.3.3" - send "0.18.0" + send "0.19.0" set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= +set-function-length@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" + integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + setprototypeof@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" @@ -1353,14 +1420,15 @@ should@^13.2.1: should-type-adaptors "^1.0.1" should-util "^1.0.0" -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== +side-channel@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.6.tgz#abd25fb7cd24baf45466406b1096b7831c9215f2" + integrity sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA== dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" + call-bind "^1.0.7" + es-errors "^1.3.0" + get-intrinsic "^1.2.4" + object-inspect "^1.13.1" signal-exit@^3.0.0: version "3.0.7" From ac8f05429f1e1bcbd9c4862d912f6c2afa99ab66 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 22:14:10 +0000 Subject: [PATCH 049/121] Bump semver from 5.7.1 to 5.7.2 Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2) --- updated-dependencies: - dependency-name: semver dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2a4c5d53..76dbce43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1304,9 +1304,9 @@ secure-keys@^1.0.0: integrity sha1-8MgtmKOxOah3aogIBQuCRDEIf8o= semver@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== send@0.19.0: version "0.19.0" From 7c474d9194ba128c94f47941683372cca5ea7bb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:23:35 +0000 Subject: [PATCH 050/121] Bump cross-spawn from 6.0.5 to 6.0.6 Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 6.0.5 to 6.0.6. - [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/v6.0.6/CHANGELOG.md) - [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.5...v6.0.6) --- updated-dependencies: - dependency-name: cross-spawn dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 76dbce43..24b21b75 100644 --- a/yarn.lock +++ b/yarn.lock @@ -294,9 +294,9 @@ core-js@^3.2.1: integrity sha512-YUdI3fFu4TF/2WykQ2xzSiTQdldLB4KVuL9WeAy5XONZYt5Cun/fpQvctoKbCgvPhmzADeesTk/j2Rdx77AcKQ== cross-spawn@^6.0.0: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + version "6.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.6.tgz#30d0efa0712ddb7eb5a76e1e8721bffafa6b5d57" + integrity sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw== dependencies: nice-try "^1.0.4" path-key "^2.0.1" From f7de432cb84e8b3fee640afa2ba8a2e8df32b8db Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 19 Dec 2024 15:42:19 +0530 Subject: [PATCH 051/121] TODO: undo this commit at the end --- composer.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/composer.json b/composer.json index a3054a52..edabaf1e 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,6 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", - "apis-guru/openapi-directory": "1.0.0", - "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, "conflict": { From 1c014811afa9655043a67e786842dd15d8f28d14 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 19 Dec 2024 18:37:33 +0530 Subject: [PATCH 052/121] Add test --- tests/IssueTest.php | 13 +++++++++++++ tests/data/issue/175/401.json | 20 ++++++++++++++++++++ tests/data/issue/175/spec.json | 20 ++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 tests/IssueTest.php create mode 100644 tests/data/issue/175/401.json create mode 100644 tests/data/issue/175/spec.json diff --git a/tests/IssueTest.php b/tests/IssueTest.php new file mode 100644 index 00000000..a350d5b7 --- /dev/null +++ b/tests/IssueTest.php @@ -0,0 +1,13 @@ +assertInstanceOf(\cebe\openapi\SpecObjectInterface::class, $openapi); + } +} diff --git a/tests/data/issue/175/401.json b/tests/data/issue/175/401.json new file mode 100644 index 00000000..eb4f5c9b --- /dev/null +++ b/tests/data/issue/175/401.json @@ -0,0 +1,20 @@ +{ + "description": "401 response", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "required": [ + "message" + ] + }, + "example": { + "message": "Unauthenticated." + } + } + } +} diff --git a/tests/data/issue/175/spec.json b/tests/data/issue/175/spec.json new file mode 100644 index 00000000..5cea0466 --- /dev/null +++ b/tests/data/issue/175/spec.json @@ -0,0 +1,20 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "My API", + "version": "1, 2" + }, + "paths": { + "/v1/users/profile": { + "get": { + "operationId": "V1GetUserProfile", + "summary": "Returns the user profile", + "responses": { + "401": { + "$ref": "./401.json" + } + } + } + } + } +} From cb65235357707060c7d28cba4ed4f3a8827706c7 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 23 Jan 2025 16:12:26 +0530 Subject: [PATCH 053/121] Create PR --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ea32da82..a077b532 100644 --- a/README.md +++ b/README.md @@ -298,3 +298,4 @@ Professional support, consulting as well as software development services are av https://www.cebe.cc/en/contact Development of this library is sponsored by [cebe.:cloud: "Your Professional Deployment Platform"](https://cebe.cloud). + From f990543b62ac0b78a7a5c6c4b91e3c92bbd41f4e Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 24 Jan 2025 19:27:11 +0530 Subject: [PATCH 054/121] Add docs --- README.md | 35 ++++++++++++++++++++++++++++++++++- composer.json | 2 -- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a077b532..d7cd0715 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,40 @@ foreach($openapi->paths as $path => $definition) { Object properties are exactly like in the [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#openapi-specification). You may also access additional properties added by [specification extensions](https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#specificationExtensions). +Read a component schema and its properties for below spec: + +```yaml +openapi: 3.0.0 +info: + title: Test API + version: 1.0.0 +paths: + /foo: + put: + description: create foo + responses: + '200': + description: request succeeded +components: + schemas: + Foo: + description: This is an description + type: object + properties: + message: + type: string + code: + type: number +``` + +```php +# read a component schema +$foo = $openapi->components->schemas['Foo']; + +# read a property of schema +$foo->properties['message'] +``` + ### Writing API Description Files ```php @@ -298,4 +332,3 @@ Professional support, consulting as well as software development services are av https://www.cebe.cc/en/contact Development of this library is sponsored by [cebe.:cloud: "Your Professional Deployment Platform"](https://cebe.cloud). - diff --git a/composer.json b/composer.json index a3054a52..edabaf1e 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,6 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", - "apis-guru/openapi-directory": "1.0.0", - "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, "conflict": { From 6788b09af61ff81f19a005426ee151ad3e3bf8de Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 24 Jan 2025 19:28:08 +0530 Subject: [PATCH 055/121] Add back removed dependencies --- composer.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/composer.json b/composer.json index edabaf1e..a3054a52 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,8 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", + "apis-guru/openapi-directory": "1.0.0", + "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, "conflict": { From e33b4103be89baab7a69585758361e8e0e8f3297 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 5 Feb 2025 19:42:29 +0530 Subject: [PATCH 056/121] Create PR --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ea32da82..a077b532 100644 --- a/README.md +++ b/README.md @@ -298,3 +298,4 @@ Professional support, consulting as well as software development services are av https://www.cebe.cc/en/contact Development of this library is sponsored by [cebe.:cloud: "Your Professional Deployment Platform"](https://cebe.cloud). + From e5751c286c8a884ee55ec117ff6e6874f6ccbfa2 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 7 Feb 2025 14:51:43 +0530 Subject: [PATCH 057/121] Implementation in progress --- Makefile | 6 ++++++ README.md | 1 - src/spec/OpenApi.php | 3 +-- src/spec/Operation.php | 2 +- tests/WriterTest.php | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 40 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index acfca9e2..0d7ca4cf 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,12 @@ fix-style: php-cs-fixer.phar $(DOCKER_PHP) vendor/bin/indent --spaces .php_cs.dist $(DOCKER_PHP) ./php-cs-fixer.phar fix src/ --diff +cli: + docker-compose run --rm php bash + +#cli_root: +# docker-compose exec --user="root" php bash + install: $(DOCKER_PHP) composer install --prefer-dist --no-interaction --no-progress --ansi $(DOCKER_NODE) yarn install diff --git a/README.md b/README.md index a077b532..ea32da82 100644 --- a/README.md +++ b/README.md @@ -298,4 +298,3 @@ Professional support, consulting as well as software development services are av https://www.cebe.cc/en/contact Development of this library is sponsored by [cebe.:cloud: "Your Professional Deployment Platform"](https://cebe.cloud). - diff --git a/src/spec/OpenApi.php b/src/spec/OpenApi.php index 29d38b38..4f62be28 100644 --- a/src/spec/OpenApi.php +++ b/src/spec/OpenApi.php @@ -7,7 +7,6 @@ namespace cebe\openapi\spec; -use cebe\openapi\exceptions\TypeErrorException; use cebe\openapi\SpecBaseObject; /** @@ -38,7 +37,7 @@ protected function attributes(): array 'servers' => [Server::class], 'paths' => Paths::class, 'components' => Components::class, - 'security' => [SecurityRequirement::class], + 'security' => [Type::STRING, SecurityRequirement::class], 'tags' => [Tag::class], 'externalDocs' => ExternalDocumentation::class, ]; diff --git a/src/spec/Operation.php b/src/spec/Operation.php index b0525327..f306a571 100644 --- a/src/spec/Operation.php +++ b/src/spec/Operation.php @@ -46,7 +46,7 @@ protected function attributes(): array 'responses' => Responses::class, 'callbacks' => [Type::STRING, Callback::class], 'deprecated' => Type::BOOLEAN, - 'security' => [SecurityRequirement::class], + 'security' => [Type::STRING, SecurityRequirement::class], 'servers' => [Server::class], ]; } diff --git a/tests/WriterTest.php b/tests/WriterTest.php index fc415b51..30c1fd82 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -1,6 +1,11 @@ new Components([ + 'securitySchemes' => [ + 'BearerAuth' => new SecurityScheme([ + 'type' => 'http', + 'scheme' => 'bearer', + 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes + ]) + ], + ]), + 'paths' => [ + '/test' => new PathItem([ + 'get' => new Operation([ + 'security' => [ + 'BearerAuth' => new SecurityRequirement([]) + ], + ]) + ]) + ] + ]); + + $result = json_decode(json_encode($openapi->getSerializableData()), true); + $this->assertTrue($result); + } } From 2f65031383982d09994375d49f7e7d9eb2b09c49 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 7 Feb 2025 16:52:18 +0530 Subject: [PATCH 058/121] In progress... --- composer.json | 2 -- src/Writer.php | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index a3054a52..edabaf1e 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,6 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", - "apis-guru/openapi-directory": "1.0.0", - "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, "conflict": { diff --git a/src/Writer.php b/src/Writer.php index faa08f46..f598ffca 100644 --- a/src/Writer.php +++ b/src/Writer.php @@ -36,6 +36,7 @@ public static function writeToJson(SpecObjectInterface $object, int $flags = JSO public static function writeToYaml(SpecObjectInterface $object): string { return Yaml::dump($object->getSerializableData(), 256, 2, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE); +// return Yaml::dump(json_decode(json_encode($object->getSerializableData()), true), 256, 2, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE); } /** From 993f1f0707d5036cfa0d70a21218086840b4d02a Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 7 Feb 2025 16:53:47 +0530 Subject: [PATCH 059/121] Add back removed packages --- composer.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/composer.json b/composer.json index edabaf1e..a3054a52 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,8 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", + "apis-guru/openapi-directory": "1.0.0", + "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, "conflict": { From 0c532a756b6080ab51c8a27e6b738879090047f6 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Tue, 11 Feb 2025 14:53:30 +0530 Subject: [PATCH 060/121] Remove comments --- src/Writer.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Writer.php b/src/Writer.php index f598ffca..faa08f46 100644 --- a/src/Writer.php +++ b/src/Writer.php @@ -36,7 +36,6 @@ public static function writeToJson(SpecObjectInterface $object, int $flags = JSO public static function writeToYaml(SpecObjectInterface $object): string { return Yaml::dump($object->getSerializableData(), 256, 2, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE); -// return Yaml::dump(json_decode(json_encode($object->getSerializableData()), true), 256, 2, Yaml::DUMP_OBJECT_AS_MAP | Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE); } /** From 2876e4af6e5ae2d5943c320bc46f8cc450dccced Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Tue, 11 Feb 2025 15:06:06 +0530 Subject: [PATCH 061/121] Finish the test --- tests/WriterTest.php | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 30c1fd82..7e083404 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -195,7 +195,7 @@ public function testWriteEmptySecurityPartYaml() public function testSecurity() { - $openapi = new OpenApi([ + $openapi = $this->createOpenAPI([ 'components' => new Components([ 'securitySchemes' => [ 'BearerAuth' => new SecurityScheme([ @@ -216,7 +216,29 @@ public function testSecurity() ] ]); - $result = json_decode(json_encode($openapi->getSerializableData()), true); - $this->assertTrue($result); + $yaml = \cebe\openapi\Writer::writeToYaml($openapi); + + + $this->assertEquals(preg_replace('~\R~', "\n", << Date: Tue, 11 Feb 2025 16:08:57 +0530 Subject: [PATCH 062/121] Changes --- src/spec/OpenApi.php | 2 +- src/spec/Operation.php | 2 +- tests/WriterTest.php | 57 +++++++++++++++++++++++++++++++++++++++--- 3 files changed, 56 insertions(+), 5 deletions(-) diff --git a/src/spec/OpenApi.php b/src/spec/OpenApi.php index 4f62be28..d22cd579 100644 --- a/src/spec/OpenApi.php +++ b/src/spec/OpenApi.php @@ -37,7 +37,7 @@ protected function attributes(): array 'servers' => [Server::class], 'paths' => Paths::class, 'components' => Components::class, - 'security' => [Type::STRING, SecurityRequirement::class], + 'security' => [SecurityRequirement::class], 'tags' => [Tag::class], 'externalDocs' => ExternalDocumentation::class, ]; diff --git a/src/spec/Operation.php b/src/spec/Operation.php index f306a571..b0525327 100644 --- a/src/spec/Operation.php +++ b/src/spec/Operation.php @@ -46,7 +46,7 @@ protected function attributes(): array 'responses' => Responses::class, 'callbacks' => [Type::STRING, Callback::class], 'deprecated' => Type::BOOLEAN, - 'security' => [Type::STRING, SecurityRequirement::class], + 'security' => [SecurityRequirement::class], 'servers' => [Server::class], ]; } diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 7e083404..b678cd2d 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -4,6 +4,8 @@ use cebe\openapi\spec\OpenApi; use cebe\openapi\spec\Operation; use cebe\openapi\spec\PathItem; +use cebe\openapi\spec\Response; +use cebe\openapi\spec\Responses; use cebe\openapi\spec\SecurityRequirement; use cebe\openapi\spec\SecurityScheme; @@ -193,7 +195,7 @@ public function testWriteEmptySecurityPartYaml() ); } - public function testSecurity() + public function testSecurityAtPathOperationLevel() { $openapi = $this->createOpenAPI([ 'components' => new Components([ @@ -209,8 +211,11 @@ public function testSecurity() '/test' => new PathItem([ 'get' => new Operation([ 'security' => [ - 'BearerAuth' => new SecurityRequirement([]) + new SecurityRequirement(['BearerAuth' => []]) ], + 'responses' => new Responses([ + 200 => new Response(['description' => 'OK']), + ]) ]) ]) ] @@ -227,8 +232,12 @@ public function testSecurity() paths: /test: get: + responses: + '200': + description: OK security: - BearerAuth: { } + - + BearerAuth: [] components: securitySchemes: BearerAuth: @@ -236,6 +245,48 @@ public function testSecurity() scheme: bearer bearerFormat: 'AuthToken and JWT Format' +YAML + ), + $yaml + ); + } + + public function testSecurityAtGlobalLevel() + { + $openapi = $this->createOpenAPI([ + 'components' => new Components([ + 'securitySchemes' => [ + 'BearerAuth' => new SecurityScheme([ + 'type' => 'http', + 'scheme' => 'bearer', + 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes + ]) + ], + ]), + 'security' => [ + 'BearerAuth' => new SecurityRequirement([]) + ], + 'paths' => [], + ]); + + $yaml = \cebe\openapi\Writer::writeToYaml($openapi); + + + $this->assertEquals(preg_replace('~\R~', "\n", << Date: Wed, 12 Feb 2025 10:45:33 +0530 Subject: [PATCH 063/121] Add `SecurityRequirements` class and more --- src/spec/OpenApi.php | 2 +- src/spec/Operation.php | 2 +- src/spec/SecurityRequirements.php | 37 +++++++++++++ tests/WriterTest.php | 89 ++++++++++++++++--------------- 4 files changed, 84 insertions(+), 46 deletions(-) create mode 100644 src/spec/SecurityRequirements.php diff --git a/src/spec/OpenApi.php b/src/spec/OpenApi.php index d22cd579..34af5587 100644 --- a/src/spec/OpenApi.php +++ b/src/spec/OpenApi.php @@ -37,7 +37,7 @@ protected function attributes(): array 'servers' => [Server::class], 'paths' => Paths::class, 'components' => Components::class, - 'security' => [SecurityRequirement::class], + 'security' => [SecurityRequirements::class], 'tags' => [Tag::class], 'externalDocs' => ExternalDocumentation::class, ]; diff --git a/src/spec/Operation.php b/src/spec/Operation.php index b0525327..d5a33d43 100644 --- a/src/spec/Operation.php +++ b/src/spec/Operation.php @@ -46,7 +46,7 @@ protected function attributes(): array 'responses' => Responses::class, 'callbacks' => [Type::STRING, Callback::class], 'deprecated' => Type::BOOLEAN, - 'security' => [SecurityRequirement::class], + 'security' => [SecurityRequirements::class], 'servers' => [Server::class], ]; } diff --git a/src/spec/SecurityRequirements.php b/src/spec/SecurityRequirements.php new file mode 100644 index 00000000..b234675a --- /dev/null +++ b/src/spec/SecurityRequirements.php @@ -0,0 +1,37 @@ + and contributors + * @license https://github.com/cebe/php-openapi/blob/master/LICENSE + */ + +namespace cebe\openapi\spec; + +use cebe\openapi\SpecBaseObject; + +/** + * Lists the required security schemes to execute this operation. + * + * @link https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#securityRequirementObject + * TODO docs + */ +class SecurityRequirements extends SpecBaseObject +{ + /** + * @return array array of attributes available in this object. + */ + protected function attributes(): array + { + // this object does not have a fixed set of attribute names + return [Type::STRING, SecurityRequirement::class]; + } + + /** + * Perform validation on this object, check data against OpenAPI Specification rules. + * + * Call `addError()` in case of validation errors. + */ + protected function performValidation() + { + } +} diff --git a/tests/WriterTest.php b/tests/WriterTest.php index b678cd2d..51f602ad 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -7,6 +7,7 @@ use cebe\openapi\spec\Response; use cebe\openapi\spec\Responses; use cebe\openapi\spec\SecurityRequirement; +use cebe\openapi\spec\SecurityRequirements; use cebe\openapi\spec\SecurityScheme; class WriterTest extends \PHPUnit\Framework\TestCase @@ -210,9 +211,9 @@ public function testSecurityAtPathOperationLevel() 'paths' => [ '/test' => new PathItem([ 'get' => new Operation([ - 'security' => [ - new SecurityRequirement(['BearerAuth' => []]) - ], + 'security' => new SecurityRequirements([ + 'BearerAuth' => new SecurityRequirement([]) + ]), 'responses' => new Responses([ 200 => new Response(['description' => 'OK']), ]) @@ -251,45 +252,45 @@ public function testSecurityAtPathOperationLevel() ); } - public function testSecurityAtGlobalLevel() - { - $openapi = $this->createOpenAPI([ - 'components' => new Components([ - 'securitySchemes' => [ - 'BearerAuth' => new SecurityScheme([ - 'type' => 'http', - 'scheme' => 'bearer', - 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes - ]) - ], - ]), - 'security' => [ - 'BearerAuth' => new SecurityRequirement([]) - ], - 'paths' => [], - ]); - - $yaml = \cebe\openapi\Writer::writeToYaml($openapi); - - - $this->assertEquals(preg_replace('~\R~', "\n", <<createOpenAPI([ +// 'components' => new Components([ +// 'securitySchemes' => [ +// 'BearerAuth' => new SecurityScheme([ +// 'type' => 'http', +// 'scheme' => 'bearer', +// 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes +// ]) +// ], +// ]), +// 'security' => [ +// 'BearerAuth' => new SecurityRequirement([]) +// ], +// 'paths' => [], +// ]); +// +// $yaml = \cebe\openapi\Writer::writeToYaml($openapi); +// +// +// $this->assertEquals(preg_replace('~\R~', "\n", << Date: Wed, 12 Feb 2025 12:05:53 +0530 Subject: [PATCH 064/121] In Progress --- src/spec/Operation.php | 2 +- src/spec/SecurityRequirements.php | 5 ++++- tests/WriterTest.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/spec/Operation.php b/src/spec/Operation.php index d5a33d43..8becca10 100644 --- a/src/spec/Operation.php +++ b/src/spec/Operation.php @@ -46,7 +46,7 @@ protected function attributes(): array 'responses' => Responses::class, 'callbacks' => [Type::STRING, Callback::class], 'deprecated' => Type::BOOLEAN, - 'security' => [SecurityRequirements::class], + 'security' => SecurityRequirements::class, 'servers' => [Server::class], ]; } diff --git a/src/spec/SecurityRequirements.php b/src/spec/SecurityRequirements.php index b234675a..718f20d0 100644 --- a/src/spec/SecurityRequirements.php +++ b/src/spec/SecurityRequirements.php @@ -22,8 +22,11 @@ class SecurityRequirements extends SpecBaseObject */ protected function attributes(): array { +// (Type::STRING => Type::ANY)[] + // this object does not have a fixed set of attribute names - return [Type::STRING, SecurityRequirement::class]; + return []; +// return [Type::STRING, SecurityRequirement::class]; } /** diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 51f602ad..a39e49f4 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -212,7 +212,7 @@ public function testSecurityAtPathOperationLevel() '/test' => new PathItem([ 'get' => new Operation([ 'security' => new SecurityRequirements([ - 'BearerAuth' => new SecurityRequirement([]) + 'BearerAuth' => new SecurityRequirement([]), ]), 'responses' => new Responses([ 200 => new Response(['description' => 'OK']), From 6fd4971e3e793e0e4b1908209a7f2542693cd76d Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 12 Feb 2025 12:07:26 +0530 Subject: [PATCH 065/121] Apply same changes to other file --- src/spec/OpenApi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spec/OpenApi.php b/src/spec/OpenApi.php index 34af5587..4a8aa243 100644 --- a/src/spec/OpenApi.php +++ b/src/spec/OpenApi.php @@ -37,7 +37,7 @@ protected function attributes(): array 'servers' => [Server::class], 'paths' => Paths::class, 'components' => Components::class, - 'security' => [SecurityRequirements::class], + 'security' => SecurityRequirements::class, 'tags' => [Tag::class], 'externalDocs' => ExternalDocumentation::class, ]; From 1e71fd564f9a5e4ed05c56e303f3fda478dffb61 Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Thu, 27 Feb 2025 07:00:41 -0500 Subject: [PATCH 066/121] allow jsonrainbow / json-schema version 6 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a3054a52..b09398d4 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "php": ">=7.1.0", "ext-json": "*", "symfony/yaml": "^3.4 || ^4 || ^5 || ^6 || ^7.0", - "justinrainbow/json-schema": "^5.2" + "justinrainbow/json-schema": "^5.2 || ^6.0" }, "require-dev": { "cebe/indent": "*", From 72292fa4e47a8c0b72cf1326cf146b4884b86064 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 12 Mar 2025 18:31:42 +0530 Subject: [PATCH 067/121] Support for https://github.com/php-openapi/yii2-openapi/issues/81 --- src/RawSpecDataInterface.php | 16 ++++++++++++++++ src/SpecBaseObject.php | 9 ++++++++- src/spec/Reference.php | 19 +++++++++++++++---- 3 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 src/RawSpecDataInterface.php diff --git a/src/RawSpecDataInterface.php b/src/RawSpecDataInterface.php new file mode 100644 index 00000000..3fecc1f0 --- /dev/null +++ b/src/RawSpecDataInterface.php @@ -0,0 +1,16 @@ + and contributors + * @license https://github.com/cebe/php-openapi/blob/master/LICENSE + */ + +namespace cebe\openapi; + +/** + * Make raw spec data available to the implementing classes + */ +interface RawSpecDataInterface +{ + public function getRawSpecData(): array; +} diff --git a/src/SpecBaseObject.php b/src/SpecBaseObject.php index 1de429bd..ef93401e 100644 --- a/src/SpecBaseObject.php +++ b/src/SpecBaseObject.php @@ -20,8 +20,9 @@ * Implements property management and validation basics. * */ -abstract class SpecBaseObject implements SpecObjectInterface, DocumentContextInterface +abstract class SpecBaseObject implements SpecObjectInterface, DocumentContextInterface, RawSpecDataInterface { + private $_rawSpec; private $_properties = []; private $_errors = []; @@ -63,6 +64,7 @@ abstract protected function performValidation(); */ public function __construct(array $data) { + $this->_rawSpec = $data; foreach ($this->attributes() as $property => $type) { if (!isset($data[$property])) { continue; @@ -525,4 +527,9 @@ public function getExtensions(): array } return $extensions; } + + public function getRawSpecData(): array + { + return $this->_rawSpec; + } } diff --git a/src/spec/Reference.php b/src/spec/Reference.php index cda612a9..f9b84d67 100644 --- a/src/spec/Reference.php +++ b/src/spec/Reference.php @@ -8,16 +8,15 @@ namespace cebe\openapi\spec; use cebe\openapi\DocumentContextInterface; -use cebe\openapi\exceptions\IOException; use cebe\openapi\exceptions\TypeErrorException; use cebe\openapi\exceptions\UnresolvableReferenceException; use cebe\openapi\json\InvalidJsonPointerSyntaxException; use cebe\openapi\json\JsonPointer; use cebe\openapi\json\JsonReference; use cebe\openapi\json\NonexistentJsonPointerReferenceException; +use cebe\openapi\RawSpecDataInterface; use cebe\openapi\ReferenceContext; use cebe\openapi\SpecObjectInterface; -use Symfony\Component\Yaml\Yaml; /** * Reference Object @@ -27,8 +26,14 @@ * @link https://tools.ietf.org/html/rfc6901 * */ -class Reference implements SpecObjectInterface, DocumentContextInterface +class Reference implements SpecObjectInterface, DocumentContextInterface, RawSpecDataInterface { + /** + * Holds raw spec data + * @var array + */ + private $_rawSpec; + /** * @var string */ @@ -61,11 +66,12 @@ class Reference implements SpecObjectInterface, DocumentContextInterface /** * Create an object from spec data. * @param array $data spec data read from YAML or JSON - * @param string $to class name of the type referenced by this Reference + * @param string|null $to class name of the type referenced by this Reference * @throws TypeErrorException in case invalid data is supplied. */ public function __construct(array $data, string $to = null) { + $this->_rawSpec = $data; if (!isset($data['$ref'])) { throw new TypeErrorException( "Unable to instantiate Reference Object with data '" . print_r($data, true) . "'." @@ -402,4 +408,9 @@ public function getDocumentPosition(): ?JsonPointer { return $this->_jsonPointer; } + + public function getRawSpecData(): array + { + return $this->_rawSpec; + } } From 69e48918c1fd0549cbf4f92065ba2efd9621b010 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 13 Mar 2025 15:18:10 +0530 Subject: [PATCH 068/121] Add tests --- tests/ReaderTest.php | 108 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/tests/ReaderTest.php b/tests/ReaderTest.php index 589b7cbb..eee95951 100644 --- a/tests/ReaderTest.php +++ b/tests/ReaderTest.php @@ -128,6 +128,114 @@ public function testSymfonyYamlBugHunt() $this->assertEquals($expectedArray, $inlineYamlExample); } + public function testGetRawSpecData() + { + $spec = <<assertSame($openapi->getRawSpecData(), [ + 'openapi' => '3.0.0', + 'info' => [ + 'version' => '1.0.0', + 'title' => 'Check storage of raw spec data', + ], + 'paths' => [ + '/' => [ + 'get' => [ + 'summary' => 'List', + 'operationId' => 'list', + 'responses' => [ + '200' => [ + 'description' => 'The information', + ] + ] + ] + ] + ], + 'components' => [ + 'schemas' => [ + 'User' => [ + 'type' => 'object', + 'properties' => [ + 'id' => [ + 'type' => 'integer', + ], + 'name' => [ + 'type' => 'string', + ] + ] + ], + 'Post' => [ + 'type' => 'object', + 'properties' => [ + 'id' => [ + 'type' => 'integer', + ], + 'title' => [ + 'type' => 'string', + ], + 'user' => [ + '$ref' => '#/components/schemas/User', + ] + ] + ] + ] + ] + ]); + + $this->assertSame($openapi->components->schemas['User']->getRawSpecData(), [ + 'type' => 'object', + 'properties' => [ + 'id' => [ + 'type' => 'integer', + ], + 'name' => [ + 'type' => 'string', + ] + ] + ]); + + $this->assertSame($openapi->components->schemas['Post']->properties['user']->getRawSpecData(), [ + '$ref' => '#/components/schemas/User', + ]); + + } + // TODO test invalid JSON // TODO test invalid YAML From b7c0a6d3011a65bfa42ab142206b83089023c484 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 14 Mar 2025 15:51:00 +0530 Subject: [PATCH 069/121] Revert changes --- src/spec/OpenApi.php | 2 +- src/spec/Operation.php | 2 +- tests/WriterTest.php | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/spec/OpenApi.php b/src/spec/OpenApi.php index 4a8aa243..d22cd579 100644 --- a/src/spec/OpenApi.php +++ b/src/spec/OpenApi.php @@ -37,7 +37,7 @@ protected function attributes(): array 'servers' => [Server::class], 'paths' => Paths::class, 'components' => Components::class, - 'security' => SecurityRequirements::class, + 'security' => [SecurityRequirement::class], 'tags' => [Tag::class], 'externalDocs' => ExternalDocumentation::class, ]; diff --git a/src/spec/Operation.php b/src/spec/Operation.php index 8becca10..b0525327 100644 --- a/src/spec/Operation.php +++ b/src/spec/Operation.php @@ -46,7 +46,7 @@ protected function attributes(): array 'responses' => Responses::class, 'callbacks' => [Type::STRING, Callback::class], 'deprecated' => Type::BOOLEAN, - 'security' => SecurityRequirements::class, + 'security' => [SecurityRequirement::class], 'servers' => [Server::class], ]; } diff --git a/tests/WriterTest.php b/tests/WriterTest.php index a39e49f4..99f28da5 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -211,9 +211,7 @@ public function testSecurityAtPathOperationLevel() 'paths' => [ '/test' => new PathItem([ 'get' => new Operation([ - 'security' => new SecurityRequirements([ - 'BearerAuth' => new SecurityRequirement([]), - ]), + 'security' => [new SecurityRequirement(['BearerAuth' => []])], 'responses' => new Responses([ 200 => new Response(['description' => 'OK']), ]) From 29f5bbbcde2382dbbd5012151cd1ee94bc1653ba Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 14 Mar 2025 17:07:56 +0530 Subject: [PATCH 070/121] Change design of SecurityScheme --- src/spec/SecurityScheme.php | 9 ++++++++ src/spec/SecuritySchemes.php | 44 ++++++++++++++++++++++++++++++++++++ tests/WriterTest.php | 17 +++++++------- 3 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 src/spec/SecuritySchemes.php diff --git a/src/spec/SecurityScheme.php b/src/spec/SecurityScheme.php index 2962f743..eb52ad86 100644 --- a/src/spec/SecurityScheme.php +++ b/src/spec/SecurityScheme.php @@ -25,6 +25,8 @@ */ class SecurityScheme extends SpecBaseObject { + public $name; + public $scheme; private $knownTypes = [ "apiKey", "http", @@ -32,6 +34,13 @@ class SecurityScheme extends SpecBaseObject "openIdConnect" ]; + public function __construct(array $data) + { + parent::__construct($data); + $this->name = array_keys($data)[0]; + $this->scheme = array_values($data)[0]; + } + /** * @return array array of attributes available in this object. */ diff --git a/src/spec/SecuritySchemes.php b/src/spec/SecuritySchemes.php new file mode 100644 index 00000000..28c7fbf2 --- /dev/null +++ b/src/spec/SecuritySchemes.php @@ -0,0 +1,44 @@ + and contributors + * @license https://github.com/cebe/php-openapi/blob/master/LICENSE + */ + +namespace cebe\openapi\spec; + +use cebe\openapi\SpecBaseObject; + +class SecuritySchemes extends SpecBaseObject +{ + private $_securitySchemes = []; + + public function __construct(array $data) + { + parent::__construct($data); + $this->_securitySchemes = $data; + } + + protected function attributes(): array + { + return []; + } + + public function performValidation() + { + } + + /** + * @return mixed returns the serializable data of this object for converting it + * to JSON or YAML. + */ + public function getSerializableData() + { + $data = []; + foreach ($this->_securitySchemes as $securityScheme) { + /** @var $securityScheme SecurityScheme */ + $data[$securityScheme->name] = $securityScheme->scheme; + } + return (object) $data; + } +} \ No newline at end of file diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 99f28da5..5e74d882 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -1,14 +1,13 @@ createOpenAPI([ 'components' => new Components([ - 'securitySchemes' => [ - 'BearerAuth' => new SecurityScheme([ - 'type' => 'http', - 'scheme' => 'bearer', - 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes + 'securitySchemes' => new SecuritySchemes([ + new SecurityScheme([ + 'BearerAuth' => [ + 'type' => 'http', + 'scheme' => 'bearer', + 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes + ] ]) - ], + ]), ]), 'paths' => [ '/test' => new PathItem([ From b46de764dd652791d82f81af7686d3810c8b0a86 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 14 Mar 2025 18:14:13 +0530 Subject: [PATCH 071/121] Complete the implementation --- src/spec/SecurityRequirements.php | 23 +++++++++++++++++++++++ src/spec/SecuritySchemes.php | 11 ++++++----- tests/WriterTest.php | 17 +++++++++-------- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/src/spec/SecurityRequirements.php b/src/spec/SecurityRequirements.php index 718f20d0..a17e5227 100644 --- a/src/spec/SecurityRequirements.php +++ b/src/spec/SecurityRequirements.php @@ -17,6 +17,14 @@ */ class SecurityRequirements extends SpecBaseObject { + private $_securityRequirements; + + public function __construct(array $data) + { + parent::__construct($data); + $this->_securityRequirements = $data; + } + /** * @return array array of attributes available in this object. */ @@ -37,4 +45,19 @@ protected function attributes(): array protected function performValidation() { } + + /** + * @return mixed returns the serializable data of this object for converting it + * to JSON or YAML. + * TODO + */ + public function getSerializableData() + { + $data = []; + foreach ($this->_securityRequirements as $name => $securityRequirement) { + /** @var SecurityRequirement $securityRequirement */ + $data[] = [$name => json_decode(json_encode($securityRequirement->getSerializableData()), true)]; + } + return $data; + } } diff --git a/src/spec/SecuritySchemes.php b/src/spec/SecuritySchemes.php index 28c7fbf2..c58dd059 100644 --- a/src/spec/SecuritySchemes.php +++ b/src/spec/SecuritySchemes.php @@ -11,7 +11,7 @@ class SecuritySchemes extends SpecBaseObject { - private $_securitySchemes = []; + private $_securitySchemes; public function __construct(array $data) { @@ -31,14 +31,15 @@ public function performValidation() /** * @return mixed returns the serializable data of this object for converting it * to JSON or YAML. + * TODO */ public function getSerializableData() { $data = []; - foreach ($this->_securitySchemes as $securityScheme) { - /** @var $securityScheme SecurityScheme */ - $data[$securityScheme->name] = $securityScheme->scheme; + foreach ($this->_securitySchemes as $name => $securityScheme) { + /** @var SecurityScheme $securityScheme */ + $data[$name] = $securityScheme->getSerializableData(); } return (object) $data; } -} \ No newline at end of file +} diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 5e74d882..99793881 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -6,6 +6,7 @@ use cebe\openapi\spec\Response; use cebe\openapi\spec\Responses; use cebe\openapi\spec\SecurityRequirement; +use cebe\openapi\spec\SecurityRequirements; use cebe\openapi\spec\SecurityScheme; use cebe\openapi\spec\SecuritySchemes; @@ -200,19 +201,19 @@ public function testSecurityAtPathOperationLevel() $openapi = $this->createOpenAPI([ 'components' => new Components([ 'securitySchemes' => new SecuritySchemes([ - new SecurityScheme([ - 'BearerAuth' => [ - 'type' => 'http', - 'scheme' => 'bearer', - 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes - ] - ]) + 'BearerAuth' => new SecurityScheme([ + 'type' => 'http', + 'scheme' => 'bearer', + 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes + ]), ]), ]), 'paths' => [ '/test' => new PathItem([ 'get' => new Operation([ - 'security' => [new SecurityRequirement(['BearerAuth' => []])], + 'security' => new SecurityRequirements([ + 'BearerAuth' => new SecurityRequirement([]), + ]), 'responses' => new Responses([ 200 => new Response(['description' => 'OK']), ]) From 219813f7e2826d782e6b705347dac654719b21ba Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 15 Mar 2025 14:34:06 +0530 Subject: [PATCH 072/121] Fix failing test --- Makefile | 3 --- src/spec/OpenApi.php | 2 +- src/spec/Operation.php | 2 +- src/spec/SecurityRequirement.php | 12 ++++++++++++ src/spec/SecurityRequirements.php | 27 ++++++++++++++++++++------- tests/WriterTest.php | 8 ++++++-- tests/spec/OpenApiTest.php | 2 +- tests/spec/OperationTest.php | 9 +++++---- 8 files changed, 46 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 0d7ca4cf..934a37f1 100644 --- a/Makefile +++ b/Makefile @@ -40,9 +40,6 @@ fix-style: php-cs-fixer.phar cli: docker-compose run --rm php bash -#cli_root: -# docker-compose exec --user="root" php bash - install: $(DOCKER_PHP) composer install --prefer-dist --no-interaction --no-progress --ansi $(DOCKER_NODE) yarn install diff --git a/src/spec/OpenApi.php b/src/spec/OpenApi.php index d22cd579..4a8aa243 100644 --- a/src/spec/OpenApi.php +++ b/src/spec/OpenApi.php @@ -37,7 +37,7 @@ protected function attributes(): array 'servers' => [Server::class], 'paths' => Paths::class, 'components' => Components::class, - 'security' => [SecurityRequirement::class], + 'security' => SecurityRequirements::class, 'tags' => [Tag::class], 'externalDocs' => ExternalDocumentation::class, ]; diff --git a/src/spec/Operation.php b/src/spec/Operation.php index b0525327..8becca10 100644 --- a/src/spec/Operation.php +++ b/src/spec/Operation.php @@ -46,7 +46,7 @@ protected function attributes(): array 'responses' => Responses::class, 'callbacks' => [Type::STRING, Callback::class], 'deprecated' => Type::BOOLEAN, - 'security' => [SecurityRequirement::class], + 'security' => SecurityRequirements::class, 'servers' => [Server::class], ]; } diff --git a/src/spec/SecurityRequirement.php b/src/spec/SecurityRequirement.php index 71f805c8..10099cae 100644 --- a/src/spec/SecurityRequirement.php +++ b/src/spec/SecurityRequirement.php @@ -17,6 +17,13 @@ */ class SecurityRequirement extends SpecBaseObject { + private $_securityRequirement; + public function __construct(array $data) + { + parent::__construct($data); + $this->_securityRequirement = $data; + } + /** * @return array array of attributes available in this object. */ @@ -34,4 +41,9 @@ protected function attributes(): array protected function performValidation() { } + + public function getSerializableData() + { + return $this->_securityRequirement; + } } diff --git a/src/spec/SecurityRequirements.php b/src/spec/SecurityRequirements.php index a17e5227..34cb0b19 100644 --- a/src/spec/SecurityRequirements.php +++ b/src/spec/SecurityRequirements.php @@ -10,7 +10,7 @@ use cebe\openapi\SpecBaseObject; /** - * Lists the required security schemes to execute this operation. + * Lists the required security requirement to execute this operation. * * @link https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#securityRequirementObject * TODO docs @@ -22,7 +22,18 @@ class SecurityRequirements extends SpecBaseObject public function __construct(array $data) { parent::__construct($data); - $this->_securityRequirements = $data; + + $read = true; + foreach($data as $index => $value) { + if (is_numeric($index)) { // read + $requirements = $value; + $this->_securityRequirements[array_keys($value)[0]] = new SecurityRequirement(array_values($value)[0]); + } else { // write + $read = false; + $requirements = $data; + $this->_securityRequirements[$index] = $value; + } + } } /** @@ -30,11 +41,8 @@ public function __construct(array $data) */ protected function attributes(): array { -// (Type::STRING => Type::ANY)[] - // this object does not have a fixed set of attribute names return []; -// return [Type::STRING, SecurityRequirement::class]; } /** @@ -54,10 +62,15 @@ protected function performValidation() public function getSerializableData() { $data = []; - foreach ($this->_securityRequirements as $name => $securityRequirement) { + foreach ($this->_securityRequirements ?? [] as $name => $securityRequirement) { /** @var SecurityRequirement $securityRequirement */ - $data[] = [$name => json_decode(json_encode($securityRequirement->getSerializableData()), true)]; + $data[] = [$name => $securityRequirement->getSerializableData()]; } return $data; } + + public function getRequirement(string $name) + { + return $this->_securityRequirements[$name] ?? 'nul5l'; + } } diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 99793881..792ae364 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -145,7 +145,9 @@ public function testWriteEmptySecurityYaml() public function testWriteEmptySecurityPartJson() { $openapi = $this->createOpenAPI([ - 'security' => [new SecurityRequirement(['Bearer' => []])], + 'security' => new SecurityRequirements([ + 'Bearer' => new SecurityRequirement([]) + ]), ]); $json = \cebe\openapi\Writer::writeToJson($openapi); @@ -174,7 +176,9 @@ public function testWriteEmptySecurityPartJson() public function testWriteEmptySecurityPartYaml() { $openapi = $this->createOpenAPI([ - 'security' => [new SecurityRequirement(['Bearer' => []])], + 'security' => new SecurityRequirements([ + 'Bearer' => new SecurityRequirement([]) + ]), ]); $yaml = \cebe\openapi\Writer::writeToYaml($openapi); diff --git a/tests/spec/OpenApiTest.php b/tests/spec/OpenApiTest.php index 20b568ed..fce2e040 100644 --- a/tests/spec/OpenApiTest.php +++ b/tests/spec/OpenApiTest.php @@ -72,7 +72,7 @@ public function testReadPetStore() $this->assertInstanceOf(\cebe\openapi\spec\Components::class, $openapi->components); // security - $this->assertAllInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $openapi->security); + $this->assertNull($openapi->security); # since it is not present in spec // tags $this->assertAllInstanceOf(\cebe\openapi\spec\Tag::class, $openapi->tags); diff --git a/tests/spec/OperationTest.php b/tests/spec/OperationTest.php index 6e30566f..b60b95ab 100644 --- a/tests/spec/OperationTest.php +++ b/tests/spec/OperationTest.php @@ -79,10 +79,11 @@ public function testRead() $this->assertInstanceOf(\cebe\openapi\spec\Responses::class, $operation->responses); - $this->assertCount(1, $operation->security); - $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $operation->security[0]); - $this->assertCount(2, $operation->security[0]->petstore_auth); - $this->assertEquals(['write:pets', 'read:pets'], $operation->security[0]->petstore_auth); + $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirements::class, $operation->security); + $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $operation->security->getRequirement('petstore_auth')); + // TODO +// $this->assertCount(2, $operation->security[0]->petstore_auth); +// $this->assertEquals(['write:pets', 'read:pets'], $operation->security[0]->petstore_auth); $this->assertInstanceOf(ExternalDocumentation::class, $operation->externalDocs); $this->assertEquals('Find more info here', $operation->externalDocs->description); From 236a47e76b11ac383dfa441898410af7245a4012 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 15 Mar 2025 15:18:20 +0530 Subject: [PATCH 073/121] Cleanup and fix issue and complete the implementation --- src/spec/SecurityRequirements.php | 12 +++++++-- src/spec/SecurityScheme.php | 9 ------- src/spec/SecuritySchemes.php | 45 ------------------------------- tests/WriterTest.php | 5 ++-- tests/spec/SecuritySchemeTest.php | 6 ++--- 5 files changed, 15 insertions(+), 62 deletions(-) delete mode 100644 src/spec/SecuritySchemes.php diff --git a/src/spec/SecurityRequirements.php b/src/spec/SecurityRequirements.php index 34cb0b19..3cd0dd00 100644 --- a/src/spec/SecurityRequirements.php +++ b/src/spec/SecurityRequirements.php @@ -24,7 +24,7 @@ public function __construct(array $data) parent::__construct($data); $read = true; - foreach($data as $index => $value) { + foreach ($data as $index => $value) { if (is_numeric($index)) { // read $requirements = $value; $this->_securityRequirements[array_keys($value)[0]] = new SecurityRequirement(array_values($value)[0]); @@ -34,6 +34,9 @@ public function __construct(array $data) $this->_securityRequirements[$index] = $value; } } + if ($data === []) { + $this->_securityRequirements = []; + } } /** @@ -71,6 +74,11 @@ public function getSerializableData() public function getRequirement(string $name) { - return $this->_securityRequirements[$name] ?? 'nul5l'; + return $this->_securityRequirements[$name] ?? null; + } + + public function getRequirements() + { + return $this->_securityRequirements; } } diff --git a/src/spec/SecurityScheme.php b/src/spec/SecurityScheme.php index eb52ad86..2962f743 100644 --- a/src/spec/SecurityScheme.php +++ b/src/spec/SecurityScheme.php @@ -25,8 +25,6 @@ */ class SecurityScheme extends SpecBaseObject { - public $name; - public $scheme; private $knownTypes = [ "apiKey", "http", @@ -34,13 +32,6 @@ class SecurityScheme extends SpecBaseObject "openIdConnect" ]; - public function __construct(array $data) - { - parent::__construct($data); - $this->name = array_keys($data)[0]; - $this->scheme = array_values($data)[0]; - } - /** * @return array array of attributes available in this object. */ diff --git a/src/spec/SecuritySchemes.php b/src/spec/SecuritySchemes.php deleted file mode 100644 index c58dd059..00000000 --- a/src/spec/SecuritySchemes.php +++ /dev/null @@ -1,45 +0,0 @@ - and contributors - * @license https://github.com/cebe/php-openapi/blob/master/LICENSE - */ - -namespace cebe\openapi\spec; - -use cebe\openapi\SpecBaseObject; - -class SecuritySchemes extends SpecBaseObject -{ - private $_securitySchemes; - - public function __construct(array $data) - { - parent::__construct($data); - $this->_securitySchemes = $data; - } - - protected function attributes(): array - { - return []; - } - - public function performValidation() - { - } - - /** - * @return mixed returns the serializable data of this object for converting it - * to JSON or YAML. - * TODO - */ - public function getSerializableData() - { - $data = []; - foreach ($this->_securitySchemes as $name => $securityScheme) { - /** @var SecurityScheme $securityScheme */ - $data[$name] = $securityScheme->getSerializableData(); - } - return (object) $data; - } -} diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 792ae364..5450b64f 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -8,7 +8,6 @@ use cebe\openapi\spec\SecurityRequirement; use cebe\openapi\spec\SecurityRequirements; use cebe\openapi\spec\SecurityScheme; -use cebe\openapi\spec\SecuritySchemes; class WriterTest extends \PHPUnit\Framework\TestCase { @@ -204,13 +203,13 @@ public function testSecurityAtPathOperationLevel() { $openapi = $this->createOpenAPI([ 'components' => new Components([ - 'securitySchemes' => new SecuritySchemes([ + 'securitySchemes' => [ 'BearerAuth' => new SecurityScheme([ 'type' => 'http', 'scheme' => 'bearer', 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes ]), - ]), + ], ]), 'paths' => [ '/test' => new PathItem([ diff --git a/tests/spec/SecuritySchemeTest.php b/tests/spec/SecuritySchemeTest.php index 5e14d5f7..4bbbf4d6 100644 --- a/tests/spec/SecuritySchemeTest.php +++ b/tests/spec/SecuritySchemeTest.php @@ -199,10 +199,10 @@ public function testDefaultSecurity() YAML ); - $this->assertSame([], $openapi->paths->getPath('/path/one')->post->security); + $this->assertSame([], $openapi->paths->getPath('/path/one')->post->security->getRequirements()); $this->assertSame(null, $openapi->paths->getPath('/path/two')->post->security); - $this->assertCount(1, $openapi->security); - $this->assertSame([], $openapi->security[0]->Bearer); + $this->assertCount(1, $openapi->security->getRequirements()); + $this->assertSame([], $openapi->security->getRequirement('Bearer')->getSerializableData()); } } From 55f3e1fb95c1100b73fbf78384107f9cb6a3facf Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 15 Mar 2025 15:24:27 +0530 Subject: [PATCH 074/121] Complete the test --- tests/spec/OperationTest.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/spec/OperationTest.php b/tests/spec/OperationTest.php index b60b95ab..35fd1fdd 100644 --- a/tests/spec/OperationTest.php +++ b/tests/spec/OperationTest.php @@ -81,9 +81,8 @@ public function testRead() $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirements::class, $operation->security); $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $operation->security->getRequirement('petstore_auth')); - // TODO -// $this->assertCount(2, $operation->security[0]->petstore_auth); -// $this->assertEquals(['write:pets', 'read:pets'], $operation->security[0]->petstore_auth); + $this->assertCount(2, $operation->security->getRequirement('petstore_auth')->getSerializableData()); + $this->assertEquals(['write:pets', 'read:pets'], $operation->security->getRequirement('petstore_auth')->getSerializableData()); $this->assertInstanceOf(ExternalDocumentation::class, $operation->externalDocs); $this->assertEquals('Find more info here', $operation->externalDocs->description); From 23a53774874d396aff1682edf20710392178f23a Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 15 Mar 2025 15:55:19 +0530 Subject: [PATCH 075/121] Covers SecurityRequirements --- tests/spec/SecuritySchemeTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/spec/SecuritySchemeTest.php b/tests/spec/SecuritySchemeTest.php index 4bbbf4d6..4dc6a2a1 100644 --- a/tests/spec/SecuritySchemeTest.php +++ b/tests/spec/SecuritySchemeTest.php @@ -11,6 +11,7 @@ * @covers \cebe\openapi\spec\OAuthFlows * @covers \cebe\openapi\spec\OAuthFlow * @covers \cebe\openapi\spec\SecurityRequirement + * @covers \cebe\openapi\spec\SecurityRequirements */ class SecuritySchemeTest extends \PHPUnit\Framework\TestCase { From 565c1830a2171ea28e7999b85632dd6b94537d47 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 15 Mar 2025 16:01:05 +0530 Subject: [PATCH 076/121] Put back removed Composer Package --- Makefile | 1 - composer.json | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 934a37f1..add949a6 100644 --- a/Makefile +++ b/Makefile @@ -85,4 +85,3 @@ coverage: .php-openapi-covA .php-openapi-covB grep -rhPo '^class \w+' src/spec/ | awk '{print $$2}' |grep -v '^Type$$' | sort > $@ .PHONY: all check-style fix-style install test lint coverage - diff --git a/composer.json b/composer.json index edabaf1e..a3054a52 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,8 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", + "apis-guru/openapi-directory": "1.0.0", + "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, "conflict": { From c1db3243e0193359617379f3e93438e38a34fbc5 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 15 Mar 2025 16:07:49 +0530 Subject: [PATCH 077/121] Fix failing tests --- tests/spec/OpenApiTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/spec/OpenApiTest.php b/tests/spec/OpenApiTest.php index fce2e040..ad99e743 100644 --- a/tests/spec/OpenApiTest.php +++ b/tests/spec/OpenApiTest.php @@ -221,7 +221,8 @@ public function testSpecs($openApiFile) } // security - $this->assertAllInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $openapi->security); + $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirements::class, $openapi->security); + $this->assertAllInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $openapi->security->getRequirements()); // tags $this->assertAllInstanceOf(\cebe\openapi\spec\Tag::class, $openapi->tags); From c911987755490395b0238ce256ababe947a8a7ac Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 15 Mar 2025 16:12:47 +0530 Subject: [PATCH 078/121] Fix failing tests 2 --- tests/spec/OpenApiTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spec/OpenApiTest.php b/tests/spec/OpenApiTest.php index ad99e743..26713344 100644 --- a/tests/spec/OpenApiTest.php +++ b/tests/spec/OpenApiTest.php @@ -221,7 +221,7 @@ public function testSpecs($openApiFile) } // security - $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirements::class, $openapi->security); + $openapi->security !== null && $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirements::class, $openapi->security); $this->assertAllInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $openapi->security->getRequirements()); // tags From 98b3ef37c5aebe306e908bd9a22bd533123519db Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 15 Mar 2025 16:15:55 +0530 Subject: [PATCH 079/121] Fix failing tests 3 --- tests/spec/OpenApiTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spec/OpenApiTest.php b/tests/spec/OpenApiTest.php index 26713344..433bd352 100644 --- a/tests/spec/OpenApiTest.php +++ b/tests/spec/OpenApiTest.php @@ -222,7 +222,7 @@ public function testSpecs($openApiFile) // security $openapi->security !== null && $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirements::class, $openapi->security); - $this->assertAllInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $openapi->security->getRequirements()); + $openapi->security !== null && $this->assertAllInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $openapi->security->getRequirements()); // tags $this->assertAllInstanceOf(\cebe\openapi\spec\Tag::class, $openapi->tags); From 15ef5f67e3e6101c879318d791fca1169cd01689 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Mon, 17 Mar 2025 07:18:57 +0530 Subject: [PATCH 080/121] Add more assertions in tests and refactor --- src/spec/SecurityRequirement.php | 1 + src/spec/SecurityRequirements.php | 7 +++---- tests/WriterTest.php | 1 + tests/spec/OperationTest.php | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/spec/SecurityRequirement.php b/src/spec/SecurityRequirement.php index 10099cae..a5e0c619 100644 --- a/src/spec/SecurityRequirement.php +++ b/src/spec/SecurityRequirement.php @@ -44,6 +44,7 @@ protected function performValidation() public function getSerializableData() { + parent::getSerializableData(); return $this->_securityRequirement; } } diff --git a/src/spec/SecurityRequirements.php b/src/spec/SecurityRequirements.php index 3cd0dd00..7821ff2a 100644 --- a/src/spec/SecurityRequirements.php +++ b/src/spec/SecurityRequirements.php @@ -23,14 +23,10 @@ public function __construct(array $data) { parent::__construct($data); - $read = true; foreach ($data as $index => $value) { if (is_numeric($index)) { // read - $requirements = $value; $this->_securityRequirements[array_keys($value)[0]] = new SecurityRequirement(array_values($value)[0]); } else { // write - $read = false; - $requirements = $data; $this->_securityRequirements[$index] = $value; } } @@ -55,6 +51,7 @@ protected function attributes(): array */ protected function performValidation() { + // TODO } /** @@ -64,6 +61,8 @@ protected function performValidation() */ public function getSerializableData() { + parent::getSerializableData(); + $data = []; foreach ($this->_securityRequirements ?? [] as $name => $securityRequirement) { /** @var SecurityRequirement $securityRequirement */ diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 5450b64f..57ca5d09 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -255,6 +255,7 @@ public function testSecurityAtPathOperationLevel() ); } + // TODO // public function testSecurityAtGlobalLevel() // { // $openapi = $this->createOpenAPI([ diff --git a/tests/spec/OperationTest.php b/tests/spec/OperationTest.php index 35fd1fdd..734db321 100644 --- a/tests/spec/OperationTest.php +++ b/tests/spec/OperationTest.php @@ -79,6 +79,7 @@ public function testRead() $this->assertInstanceOf(\cebe\openapi\spec\Responses::class, $operation->responses); + $this->assertCount(1, $operation->security->getRequirements()); $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirements::class, $operation->security); $this->assertInstanceOf(\cebe\openapi\spec\SecurityRequirement::class, $operation->security->getRequirement('petstore_auth')); $this->assertCount(2, $operation->security->getRequirement('petstore_auth')->getSerializableData()); From 19e68bfbd4828f4eefbb14c31cda5a5b0ec8e0ea Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Mon, 17 Mar 2025 07:30:34 +0530 Subject: [PATCH 081/121] Add more test --- tests/WriterTest.php | 84 ++++++++++++++++++++++---------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/tests/WriterTest.php b/tests/WriterTest.php index 57ca5d09..355a7449 100644 --- a/tests/WriterTest.php +++ b/tests/WriterTest.php @@ -255,46 +255,46 @@ public function testSecurityAtPathOperationLevel() ); } - // TODO -// public function testSecurityAtGlobalLevel() -// { -// $openapi = $this->createOpenAPI([ -// 'components' => new Components([ -// 'securitySchemes' => [ -// 'BearerAuth' => new SecurityScheme([ -// 'type' => 'http', -// 'scheme' => 'bearer', -// 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes -// ]) -// ], -// ]), -// 'security' => [ -// 'BearerAuth' => new SecurityRequirement([]) -// ], -// 'paths' => [], -// ]); -// -// $yaml = \cebe\openapi\Writer::writeToYaml($openapi); -// -// -// $this->assertEquals(preg_replace('~\R~', "\n", <<createOpenAPI([ + 'components' => new Components([ + 'securitySchemes' => [ + 'BearerAuth' => new SecurityScheme([ + 'type' => 'http', + 'scheme' => 'bearer', + 'bearerFormat' => 'AuthToken and JWT Format' # optional, arbitrary value for documentation purposes + ]) + ], + ]), + 'security' => new SecurityRequirements([ + 'BearerAuth' => new SecurityRequirement([]) + ]), + 'paths' => [], + ]); + + $yaml = \cebe\openapi\Writer::writeToYaml($openapi); + + + $this->assertEquals(preg_replace('~\R~', "\n", << Date: Mon, 17 Mar 2025 16:28:28 +0530 Subject: [PATCH 082/121] Resolve TODOs --- src/spec/SecurityRequirement.php | 2 +- src/spec/SecurityRequirements.php | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/spec/SecurityRequirement.php b/src/spec/SecurityRequirement.php index a5e0c619..069c7711 100644 --- a/src/spec/SecurityRequirement.php +++ b/src/spec/SecurityRequirement.php @@ -10,7 +10,7 @@ use cebe\openapi\SpecBaseObject; /** - * Lists the required security schemes to execute this operation. + * A required security scheme to execute this operation. * * @link https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#securityRequirementObject * diff --git a/src/spec/SecurityRequirements.php b/src/spec/SecurityRequirements.php index 7821ff2a..3b3bbb90 100644 --- a/src/spec/SecurityRequirements.php +++ b/src/spec/SecurityRequirements.php @@ -10,10 +10,10 @@ use cebe\openapi\SpecBaseObject; /** - * Lists the required security requirement to execute this operation. + * Lists the required security schemes to execute this operation. * * @link https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#securityRequirementObject - * TODO docs + * */ class SecurityRequirements extends SpecBaseObject { @@ -51,13 +51,10 @@ protected function attributes(): array */ protected function performValidation() { - // TODO } /** - * @return mixed returns the serializable data of this object for converting it - * to JSON or YAML. - * TODO + * {@inheritDoc} */ public function getSerializableData() { From 28c1b64b7a66152289980882db0dc4806ad410a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 12:46:27 +0000 Subject: [PATCH 083/121] Bump prismjs from 1.27.0 to 1.30.0 Bumps [prismjs](https://github.com/PrismJS/prism) from 1.27.0 to 1.30.0. - [Release notes](https://github.com/PrismJS/prism/releases) - [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md) - [Commits](https://github.com/PrismJS/prism/compare/v1.27.0...v1.30.0) --- updated-dependencies: - dependency-name: prismjs dependency-version: 1.30.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 24b21b75..c940d0aa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1144,9 +1144,9 @@ polished@^3.0.3: "@babel/runtime" "^7.12.5" prismjs@^1.15.0: - version "1.27.0" - resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.27.0.tgz#bb6ee3138a0b438a3653dd4d6ce0cc6510a45057" - integrity sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA== + version "1.30.0" + resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.30.0.tgz#d9709969d9d4e16403f6f348c63553b19f0975a9" + integrity sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw== process@^0.11.10: version "0.11.10" From 2fb30669aaf56625ac0e0d3ca5a3536c29d9f14a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 12:47:18 +0000 Subject: [PATCH 084/121] Bump @babel/runtime from 7.17.2 to 7.27.0 Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.17.2 to 7.27.0. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.27.0/packages/babel-runtime) --- updated-dependencies: - dependency-name: "@babel/runtime" dependency-version: 7.27.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 24b21b75..71d8fa0d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -24,11 +24,11 @@ js-tokens "^4.0.0" "@babel/runtime@^7.0.0", "@babel/runtime@^7.12.5": - version "7.17.2" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.2.tgz#66f68591605e59da47523c631416b18508779941" - integrity sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw== + version "7.27.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.27.0.tgz#fbee7cf97c709518ecc1f590984481d5460d4762" + integrity sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw== dependencies: - regenerator-runtime "^0.13.4" + regenerator-runtime "^0.14.0" "@cloudflare/json-schema-walker@^0.1.1": version "0.1.1" @@ -1273,10 +1273,10 @@ reftools@^1.1.0, reftools@^1.1.9: resolved "https://registry.yarnpkg.com/reftools/-/reftools-1.1.9.tgz#e16e19f662ccd4648605312c06d34e5da3a2b77e" integrity sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w== -regenerator-runtime@^0.13.4: - version "0.13.9" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" - integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== +regenerator-runtime@^0.14.0: + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== require-directory@^2.1.1: version "2.1.1" From 9acecc87c5d671c0c4dba8c0a201a22c2096e2c9 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 25 Apr 2025 18:15:53 +0530 Subject: [PATCH 085/121] Failing test --- compiled.yml | 124 +++++++++++++++++++++++ tests/spec/PathTest.php | 6 +- tests/spec/data/path-params/openapi.yaml | 6 +- tests/spec/data/path-params/user.yaml | 3 +- 4 files changed, 132 insertions(+), 7 deletions(-) create mode 100644 compiled.yml diff --git a/compiled.yml b/compiled.yml new file mode 100644 index 00000000..d544b3c3 --- /dev/null +++ b/compiled.yml @@ -0,0 +1,124 @@ +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: hi there + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index e5be1bfd..1ce585ae 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -205,8 +205,8 @@ public function testPathParametersAreArrays() $this->assertInstanceOf(Paths::class, $openapi->paths); $this->assertIsArray($openapi->paths->getPaths()); - $this->assertInstanceOf(PathItem::class, $usersPath = $openapi->paths['/v1/{organizationId}/user']); - $this->assertInstanceOf(PathItem::class, $userIdPath = $openapi->paths['/v1/{organizationId}/user/{id}']); + $this->assertInstanceOf(PathItem::class, $usersPath = $openapi->paths['/v1/organizations/{organizationId}/user']); + $this->assertInstanceOf(PathItem::class, $userIdPath = $openapi->paths['/v1/organizations/{organizationId}/user/{id}']); $result = $usersPath->validate(); $this->assertTrue($result); @@ -220,7 +220,7 @@ public function testPathParametersAreArrays() $this->assertIsArray($userIdPath->parameters); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); - $this->assertEquals($userIdPath->parameters[2]->name, 'id'); + $this->assertEquals($userIdPath->parameters[2]->name, 'id'); } } diff --git a/tests/spec/data/path-params/openapi.yaml b/tests/spec/data/path-params/openapi.yaml index 722d8184..9decce27 100644 --- a/tests/spec/data/path-params/openapi.yaml +++ b/tests/spec/data/path-params/openapi.yaml @@ -11,8 +11,8 @@ servers: - url: 'http://localhost:8000' description: 'Test' -paths: - /v1/{organizationId}/user: +paths: + /v1/organizations/{organizationId}/user: $ref: 'user.yaml#/paths/Users' - /v1/{organizationId}/user/{id}: + /v1/organizations/{organizationId}/user/{id}: $ref: 'user.yaml#/paths/UserId' \ No newline at end of file diff --git a/tests/spec/data/path-params/user.yaml b/tests/spec/data/path-params/user.yaml index a842e783..23857811 100644 --- a/tests/spec/data/path-params/user.yaml +++ b/tests/spec/data/path-params/user.yaml @@ -1,3 +1,4 @@ + paths: Users: parameters: @@ -73,4 +74,4 @@ components: schema: type: string format: uuid - description: User's ID \ No newline at end of file + description: User's ID From 2a660593cbe4b8bf650db6d648f36bdda66b86bd Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 25 Apr 2025 18:22:59 +0530 Subject: [PATCH 086/121] Remove redundant method call --- src/spec/SecurityRequirement.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/spec/SecurityRequirement.php b/src/spec/SecurityRequirement.php index 069c7711..ec3e1d90 100644 --- a/src/spec/SecurityRequirement.php +++ b/src/spec/SecurityRequirement.php @@ -44,7 +44,6 @@ protected function performValidation() public function getSerializableData() { - parent::getSerializableData(); return $this->_securityRequirement; } } From 3ab78b6b4a8ba79d79b241b620e454a6a1019b47 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 26 Apr 2025 09:44:25 +0530 Subject: [PATCH 087/121] Original compiled file --- compiled.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/compiled.yml b/compiled.yml index d544b3c3..380bd8a5 100644 --- a/compiled.yml +++ b/compiled.yml @@ -53,14 +53,16 @@ paths: - BearerAuth: [] parameters: - - name: organizationId + '1': + name: organizationId in: path description: 'The Organization ID' required: true schema: type: string format: uuid - - name: api-version + '0': + name: api-version in: header description: 'The API version' required: false @@ -73,7 +75,7 @@ paths: summary: 'Gets a user' responses: '200': - description: hi there + description: 'A bar' content: application/json: schema: @@ -97,7 +99,7 @@ paths: - BearerAuth: [] parameters: - - + '1': name: organizationId in: path description: 'The Organization ID' @@ -105,7 +107,7 @@ paths: schema: type: string format: uuid - - + '0': name: api-version in: header description: 'The API version' @@ -114,7 +116,7 @@ paths: type: string format: date example: '2021-05-18' - - + '2': name: id in: path description: 'User''s ID' From a946647b976e639690d8737679db63b3f06fa114 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Tue, 29 Apr 2025 12:38:29 +0530 Subject: [PATCH 088/121] Fix typo --- bin/php-openapi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/php-openapi b/bin/php-openapi index ae2ffdc8..aa4b0697 100755 --- a/bin/php-openapi +++ b/bin/php-openapi @@ -215,7 +215,7 @@ switch ($command) { if ($outputFile === null) { if ($outputFormat === null) { - error("No output fromat specified, please specify --write-json or --write-yaml.", "usage"); + error("No output format specified, please specify --write-json or --write-yaml.", "usage"); } elseif ($outputFormat === 'json') { fwrite(STDOUT, \cebe\openapi\Writer::writeToJson($openApi)); } else { From aa73b3d3ae8b745cf794dc8e7a2f6403b11d6b77 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Tue, 29 Apr 2025 12:39:34 +0530 Subject: [PATCH 089/121] Remove redundant method call 2 --- src/spec/SecurityRequirements.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/spec/SecurityRequirements.php b/src/spec/SecurityRequirements.php index 3b3bbb90..cbda1ba7 100644 --- a/src/spec/SecurityRequirements.php +++ b/src/spec/SecurityRequirements.php @@ -58,8 +58,6 @@ protected function performValidation() */ public function getSerializableData() { - parent::getSerializableData(); - $data = []; foreach ($this->_securityRequirements ?? [] as $name => $securityRequirement) { /** @var SecurityRequirement $securityRequirement */ From aaff77168508b3d41ef2df307da089e1ffcc9470 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 07:47:17 +0530 Subject: [PATCH 090/121] Fix this issue --- compiled.yml | 40 ++++++++++++++------------- src/SpecBaseObject.php | 4 +++ tests/spec/data/path-params/user.yaml | 2 ++ 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/compiled.yml b/compiled.yml index 380bd8a5..e1774005 100644 --- a/compiled.yml +++ b/compiled.yml @@ -13,6 +13,8 @@ servers: paths: '/v1/organizations/{organizationId}/user': post: + tags: + - pets summary: 'Creates a user' requestBody: content: @@ -53,15 +55,7 @@ paths: - BearerAuth: [] parameters: - '1': - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '0': + - name: api-version in: header description: 'The API version' @@ -70,6 +64,14 @@ paths: type: string format: date example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid '/v1/organizations/{organizationId}/user/{id}': get: summary: 'Gets a user' @@ -99,15 +101,7 @@ paths: - BearerAuth: [] parameters: - '1': - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '0': + - name: api-version in: header description: 'The API version' @@ -116,7 +110,15 @@ paths: type: string format: date example: '2021-05-18' - '2': + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - name: id in: path description: 'User''s ID' diff --git a/src/SpecBaseObject.php b/src/SpecBaseObject.php index ef93401e..a1008ce9 100644 --- a/src/SpecBaseObject.php +++ b/src/SpecBaseObject.php @@ -210,6 +210,10 @@ public function getSerializableData() // case 2: Attribute type is an object (specified in attributes() by an array which specifies two items (key and value type) $toObject = true; } + if ($k === 'parameters') { + ksort($data[$k]); + $toObject = false; + } if ($toObject) { $data[$k] = (object) $data[$k]; } diff --git a/tests/spec/data/path-params/user.yaml b/tests/spec/data/path-params/user.yaml index 23857811..6f1402bd 100644 --- a/tests/spec/data/path-params/user.yaml +++ b/tests/spec/data/path-params/user.yaml @@ -6,6 +6,8 @@ paths: - $ref: 'global.yaml#/components/parameters/OrganizationId' post: summary: Creates a user + tags: + - pets security: - BearerAuth: [] requestBody: From e02cce13728aa8a9d764b069d0e94374cc554e75 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 08:18:45 +0530 Subject: [PATCH 091/121] Fix this issue in more proper way --- src/SpecBaseObject.php | 4 ---- src/spec/PathItem.php | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/SpecBaseObject.php b/src/SpecBaseObject.php index a1008ce9..ef93401e 100644 --- a/src/SpecBaseObject.php +++ b/src/SpecBaseObject.php @@ -210,10 +210,6 @@ public function getSerializableData() // case 2: Attribute type is an object (specified in attributes() by an array which specifies two items (key and value type) $toObject = true; } - if ($k === 'parameters') { - ksort($data[$k]); - $toObject = false; - } if ($toObject) { $data[$k] = (object) $data[$k]; } diff --git a/src/spec/PathItem.php b/src/spec/PathItem.php index 4b2debcd..6930e0af 100644 --- a/src/spec/PathItem.php +++ b/src/spec/PathItem.php @@ -180,7 +180,7 @@ public function resolveReferences(ReferenceContext $context = null) foreach ($this->$attribute as $k => $item) { if ($item instanceof Reference) { $referencedObject = $item->resolve(); - $this->$attribute = [$k => $referencedObject] + $this->$attribute; + $this->$attribute = $this->$attribute + [$k => $referencedObject]; if (!$referencedObject instanceof Reference && $referencedObject !== null) { $referencedObject->resolveReferences(); } From e8b8b2e627df63ec338f46c400eb819ec6f31017 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 08:28:27 +0530 Subject: [PATCH 092/121] Fix failing test --- tests/spec/PathTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 1ce585ae..d4b54ed1 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -204,7 +204,7 @@ public function testPathParametersAreArrays() $this->assertTrue($result); $this->assertInstanceOf(Paths::class, $openapi->paths); - $this->assertIsArray($openapi->paths->getPaths()); + $this->assertSame(gettype($openapi->paths->getPaths()), 'array'); $this->assertInstanceOf(PathItem::class, $usersPath = $openapi->paths['/v1/organizations/{organizationId}/user']); $this->assertInstanceOf(PathItem::class, $userIdPath = $openapi->paths['/v1/organizations/{organizationId}/user/{id}']); @@ -213,14 +213,14 @@ public function testPathParametersAreArrays() $this->assertIsArray($usersPath->parameters); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $usersPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $usersPath->parameters[1]); - $this->assertEquals($usersPath->parameters[0]->name, 'api-version'); + $this->assertEquals('api-version', $usersPath->parameters[0]->name); $result = $userIdPath->validate(); $this->assertTrue($result); $this->assertIsArray($userIdPath->parameters); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); - $this->assertEquals($userIdPath->parameters[2]->name, 'id'); + $this->assertEquals('id', $userIdPath->parameters[2]->name); } } From 9dfa3e80322376bddd133da9eb7c71923fb8bde3 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 08:34:44 +0530 Subject: [PATCH 093/121] Fix failing test 2 --- tests/spec/PathTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index d4b54ed1..83b7aab5 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -210,14 +210,14 @@ public function testPathParametersAreArrays() $result = $usersPath->validate(); $this->assertTrue($result); - $this->assertIsArray($usersPath->parameters); + $this->assertSame(gettype($usersPath->parameters), 'array'); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $usersPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $usersPath->parameters[1]); $this->assertEquals('api-version', $usersPath->parameters[0]->name); $result = $userIdPath->validate(); $this->assertTrue($result); - $this->assertIsArray($userIdPath->parameters); + $this->assertSame(gettype($userIdPath->parameters), 'array'); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); $this->assertEquals('id', $userIdPath->parameters[2]->name); From f0a27b743b4a47dd5c127bb0e016af5bbdd03837 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 09:03:59 +0530 Subject: [PATCH 094/121] Add more assertions --- compiled.yml => tests/data/issue/155/compiled.yml | 0 tests/spec/PathTest.php | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) rename compiled.yml => tests/data/issue/155/compiled.yml (100%) diff --git a/compiled.yml b/tests/data/issue/155/compiled.yml similarity index 100% rename from compiled.yml rename to tests/data/issue/155/compiled.yml diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 83b7aab5..522ff924 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -221,6 +221,7 @@ public function testPathParametersAreArrays() $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); $this->assertEquals('id', $userIdPath->parameters[2]->name); - + shell_exec(dirname(__DIR__, 2) . '/bin/php-openapi inline ' . $file . ' ' . dirname(__DIR__) . '/tmp/compiled.yml'); + $this->assertFileEquals(dirname(__DIR__) . '/tmp/compiled.yml', dirname(__DIR__) . '/data/issue/155/compiled.yml'); } } From 02b63bdb3d0251aafdae0e6f5126a8b28b1b8fbc Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 14:02:45 +0530 Subject: [PATCH 095/121] Fix issue in Github action --- tests/spec/PathTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 522ff924..8fbc6fcc 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -221,7 +221,8 @@ public function testPathParametersAreArrays() $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); $this->assertEquals('id', $userIdPath->parameters[2]->name); - shell_exec(dirname(__DIR__, 2) . '/bin/php-openapi inline ' . $file . ' ' . dirname(__DIR__) . '/tmp/compiled.yml'); - $this->assertFileEquals(dirname(__DIR__) . '/tmp/compiled.yml', dirname(__DIR__) . '/data/issue/155/compiled.yml'); + shell_exec(dirname(__DIR__, 2) . '/bin/php-openapi inline ' . $file . ' ' . dirname(__DIR__) . '/compiled.yml'); + $this->assertFileEquals(dirname(__DIR__) . '/compiled.yml', dirname(__DIR__) . '/data/issue/155/compiled.yml'); + unlink(dirname(__DIR__) . '/compiled.yml'); } } From 61fe21687ebbc080002ee36da3a91eb88b343ecc Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 14:14:38 +0530 Subject: [PATCH 096/121] Fix issue in Github action for Windows --- tests/spec/PathTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 8fbc6fcc..ad9a24c7 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -221,8 +221,9 @@ public function testPathParametersAreArrays() $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); $this->assertEquals('id', $userIdPath->parameters[2]->name); - shell_exec(dirname(__DIR__, 2) . '/bin/php-openapi inline ' . $file . ' ' . dirname(__DIR__) . '/compiled.yml'); - $this->assertFileEquals(dirname(__DIR__) . '/compiled.yml', dirname(__DIR__) . '/data/issue/155/compiled.yml'); - unlink(dirname(__DIR__) . '/compiled.yml'); + $dirSep = DIRECTORY_SEPARATOR; + shell_exec(dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . dirname(__DIR__) . $dirSep.'/compiled.yml'); + $this->assertFileEquals(dirname(__DIR__) . $dirSep.'compiled.yml', dirname(__DIR__) . "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled.yml"); + unlink(dirname(__DIR__) . $dirSep.'compiled.yml'); } } From 2e89e6add318c3acfd4d8abda4d562d88e766fee Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 15:23:09 +0530 Subject: [PATCH 097/121] Fix issue in Github action 2 - related to different symfony/yaml version --- .../{compiled.yml => compiled-symfony-5.yml} | 0 tests/data/issue/155/compiled-symfony-6.yml | 128 ++++++++++++++++++ tests/data/issue/155/compiled-symfony-7.yml | 128 ++++++++++++++++++ tests/spec/PathTest.php | 29 +++- 4 files changed, 282 insertions(+), 3 deletions(-) rename tests/data/issue/155/{compiled.yml => compiled-symfony-5.yml} (100%) create mode 100644 tests/data/issue/155/compiled-symfony-6.yml create mode 100644 tests/data/issue/155/compiled-symfony-7.yml diff --git a/tests/data/issue/155/compiled.yml b/tests/data/issue/155/compiled-symfony-5.yml similarity index 100% rename from tests/data/issue/155/compiled.yml rename to tests/data/issue/155/compiled-symfony-5.yml diff --git a/tests/data/issue/155/compiled-symfony-6.yml b/tests/data/issue/155/compiled-symfony-6.yml new file mode 100644 index 00000000..e1774005 --- /dev/null +++ b/tests/data/issue/155/compiled-symfony-6.yml @@ -0,0 +1,128 @@ +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid diff --git a/tests/data/issue/155/compiled-symfony-7.yml b/tests/data/issue/155/compiled-symfony-7.yml new file mode 100644 index 00000000..e1774005 --- /dev/null +++ b/tests/data/issue/155/compiled-symfony-7.yml @@ -0,0 +1,128 @@ +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index ad9a24c7..9d3e2e6d 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -223,7 +223,30 @@ public function testPathParametersAreArrays() $this->assertEquals('id', $userIdPath->parameters[2]->name); $dirSep = DIRECTORY_SEPARATOR; shell_exec(dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . dirname(__DIR__) . $dirSep.'/compiled.yml'); - $this->assertFileEquals(dirname(__DIR__) . $dirSep.'compiled.yml', dirname(__DIR__) . "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled.yml"); - unlink(dirname(__DIR__) . $dirSep.'compiled.yml'); - } + + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-7.yml"; + + if (static::majorSymfonyYamlVersion() == 6) { + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; + } elseif (static::majorSymfonyYamlVersion() == 7) { + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; + } + + $this->assertFileEquals(dirname(__DIR__) . $dirSep.'compiled.yml', dirname(__DIR__) . $expected); + unlink(dirname(__DIR__) . '/compiled.yml'); + } + + public static function majorSymfonyYamlVersion() + { + $package = 'symfony/yaml'; + $installed = json_decode(file_get_contents(__DIR__ . '/../../composer.lock'), true); + + foreach ($installed['packages'] as $pkg) { + if ($pkg['name'] === $package) { + $version = explode('.', $pkg['version'])[0]; + return str_replace('v', '', $version); + } + } + return 7; + } } From e04fc8371b2f1c37f13ae1e6383b27cee2af0502 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 15:26:30 +0530 Subject: [PATCH 098/121] Fix issue in Github action 3 - related to different symfony/yaml version --- tests/spec/PathTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 9d3e2e6d..4a3f4cb8 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -228,8 +228,8 @@ public function testPathParametersAreArrays() if (static::majorSymfonyYamlVersion() == 6) { $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; - } elseif (static::majorSymfonyYamlVersion() == 7) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; + } elseif (static::majorSymfonyYamlVersion() == 5) { + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-5.yml"; } $this->assertFileEquals(dirname(__DIR__) . $dirSep.'compiled.yml', dirname(__DIR__) . $expected); From b12c74660a7232a91b002f85fe6766912d785d5a Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 15:31:39 +0530 Subject: [PATCH 099/121] Fix issue in Github action 4 - related to different symfony/yaml version --- tests/data/issue/155/compiled-symfony-6.yml | 2 +- tests/data/issue/155/compiled-symfony-7.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/data/issue/155/compiled-symfony-6.yml b/tests/data/issue/155/compiled-symfony-6.yml index e1774005..e7a45025 100644 --- a/tests/data/issue/155/compiled-symfony-6.yml +++ b/tests/data/issue/155/compiled-symfony-6.yml @@ -121,7 +121,7 @@ paths: - name: id in: path - description: 'User''s ID' + description: "User's ID" required: true schema: type: string diff --git a/tests/data/issue/155/compiled-symfony-7.yml b/tests/data/issue/155/compiled-symfony-7.yml index e1774005..e7a45025 100644 --- a/tests/data/issue/155/compiled-symfony-7.yml +++ b/tests/data/issue/155/compiled-symfony-7.yml @@ -121,7 +121,7 @@ paths: - name: id in: path - description: 'User''s ID' + description: "User's ID" required: true schema: type: string From db60bff10aec8e16d711fa2348cc7c67427714bf Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 15:35:23 +0530 Subject: [PATCH 100/121] Fix issue in Github action 5 - related to different symfony/yaml version --- tests/data/issue/155/compiled-symfony-6.yml | 2 +- tests/spec/PathTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/data/issue/155/compiled-symfony-6.yml b/tests/data/issue/155/compiled-symfony-6.yml index e7a45025..e1774005 100644 --- a/tests/data/issue/155/compiled-symfony-6.yml +++ b/tests/data/issue/155/compiled-symfony-6.yml @@ -121,7 +121,7 @@ paths: - name: id in: path - description: "User's ID" + description: 'User''s ID' required: true schema: type: string diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 4a3f4cb8..d79fcca3 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -232,7 +232,7 @@ public function testPathParametersAreArrays() $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-5.yml"; } - $this->assertFileEquals(dirname(__DIR__) . $dirSep.'compiled.yml', dirname(__DIR__) . $expected); + $this->assertFileEquals(dirname(__DIR__) . $expected, dirname(__DIR__) . $dirSep.'compiled.yml'); unlink(dirname(__DIR__) . '/compiled.yml'); } From 7f34a3bc6112fc40019f2c169b56a76302faed76 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Wed, 30 Apr 2025 15:39:17 +0530 Subject: [PATCH 101/121] Fix issue in Github action 6 - related to different symfony/yaml version --- tests/data/issue/155/compiled-symfony-6.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data/issue/155/compiled-symfony-6.yml b/tests/data/issue/155/compiled-symfony-6.yml index e1774005..e7a45025 100644 --- a/tests/data/issue/155/compiled-symfony-6.yml +++ b/tests/data/issue/155/compiled-symfony-6.yml @@ -121,7 +121,7 @@ paths: - name: id in: path - description: 'User''s ID' + description: "User's ID" required: true schema: type: string From e05cbd03d92f66204c7d96b88f3d9cdf702483e6 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 2 May 2025 16:38:10 +0530 Subject: [PATCH 102/121] Fix issue in Github action 7 - related to different symfony/yaml version --- tests/data/issue/155/compiled-symfony-6.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data/issue/155/compiled-symfony-6.yml b/tests/data/issue/155/compiled-symfony-6.yml index e7a45025..e1774005 100644 --- a/tests/data/issue/155/compiled-symfony-6.yml +++ b/tests/data/issue/155/compiled-symfony-6.yml @@ -121,7 +121,7 @@ paths: - name: id in: path - description: "User's ID" + description: 'User''s ID' required: true schema: type: string From 9811689cb5d43d650dbf406d8cedba7476a983f5 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 2 May 2025 16:46:13 +0530 Subject: [PATCH 103/121] Fix issue in Github action 8 - related to different symfony/yaml version --- tests/spec/PathTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index d79fcca3..d0d18fb6 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -228,6 +228,9 @@ public function testPathParametersAreArrays() if (static::majorSymfonyYamlVersion() == 6) { $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; + if (version_compare(PHP_VERSION, '8.1', '>=')) { + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-7.yml"; + } } elseif (static::majorSymfonyYamlVersion() == 5) { $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-5.yml"; } From 7e721bf037e25fa644644853ac82085049cf001a Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 2 May 2025 17:40:55 +0530 Subject: [PATCH 104/121] Fix issue in Github action 9 - related to different symfony/yaml version --- tests/spec/PathTest.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index d0d18fb6..92f9082f 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -225,13 +225,15 @@ public function testPathParametersAreArrays() shell_exec(dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . dirname(__DIR__) . $dirSep.'/compiled.yml'); $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-7.yml"; + $version = static::symfonyYamlVersion(); + $majorVersion = explode('.', $version)[0]; - if (static::majorSymfonyYamlVersion() == 6) { + if ($majorVersion == 6) { $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; - if (version_compare(PHP_VERSION, '8.1', '>=')) { + if (version_compare(PHP_VERSION, '8.1', '>=') && version_compare($version, '6.0.0', '!=')) { $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-7.yml"; } - } elseif (static::majorSymfonyYamlVersion() == 5) { + } elseif ($majorVersion == 5) { $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-5.yml"; } @@ -239,17 +241,16 @@ public function testPathParametersAreArrays() unlink(dirname(__DIR__) . '/compiled.yml'); } - public static function majorSymfonyYamlVersion() + public static function symfonyYamlVersion() { $package = 'symfony/yaml'; $installed = json_decode(file_get_contents(__DIR__ . '/../../composer.lock'), true); foreach ($installed['packages'] as $pkg) { if ($pkg['name'] === $package) { - $version = explode('.', $pkg['version'])[0]; - return str_replace('v', '', $version); + return str_replace('v', '', $pkg['version']); } } - return 7; + return '7.0.0'; } } From 241c469e5f61aa6bcd37f74268b62f15ac01c277 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 2 May 2025 17:51:05 +0530 Subject: [PATCH 105/121] Fix test on Windows --- tests/spec/PathTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 92f9082f..1b5e3845 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -222,7 +222,7 @@ public function testPathParametersAreArrays() $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); $this->assertEquals('id', $userIdPath->parameters[2]->name); $dirSep = DIRECTORY_SEPARATOR; - shell_exec(dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . dirname(__DIR__) . $dirSep.'/compiled.yml'); + shell_exec('php '.dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . dirname(__DIR__) . $dirSep.'/compiled.yml'); $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-7.yml"; $version = static::symfonyYamlVersion(); From 1e379ae61b9f1bc59bfcb6818d80e403bca43c51 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 07:24:03 +0530 Subject: [PATCH 106/121] Fix test on Windows 2 --- ....yml => compiled-symfony-6-windows-lf.yml} | 256 +++++++++--------- tests/spec/PathTest.php | 5 +- 2 files changed, 132 insertions(+), 129 deletions(-) rename tests/data/issue/155/{compiled-symfony-5.yml => compiled-symfony-6-windows-lf.yml} (96%) diff --git a/tests/data/issue/155/compiled-symfony-5.yml b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml similarity index 96% rename from tests/data/issue/155/compiled-symfony-5.yml rename to tests/data/issue/155/compiled-symfony-6-windows-lf.yml index e1774005..70aa7317 100644 --- a/tests/data/issue/155/compiled-symfony-5.yml +++ b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml @@ -1,128 +1,128 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: 'User''s ID' - required: true - schema: - type: string - format: uuid +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 1b5e3845..9d2b0727 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -234,7 +234,10 @@ public function testPathParametersAreArrays() $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-7.yml"; } } elseif ($majorVersion == 5) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-5.yml"; + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; + } + if (stripos(PHP_OS, 'WIN') === 0) { + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6-windows-lf.yml"; } $this->assertFileEquals(dirname(__DIR__) . $expected, dirname(__DIR__) . $dirSep.'compiled.yml'); From 5bebb98868fecc52ab9cf717585aef9ad5d85ced Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 07:48:27 +0530 Subject: [PATCH 107/121] Fix test related to line ending --- .../155/compiled-symfony-6-windows-lf.yml | 256 +++++++++--------- 1 file changed, 128 insertions(+), 128 deletions(-) diff --git a/tests/data/issue/155/compiled-symfony-6-windows-lf.yml b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml index 70aa7317..e1774005 100644 --- a/tests/data/issue/155/compiled-symfony-6-windows-lf.yml +++ b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml @@ -1,128 +1,128 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: 'User''s ID' - required: true - schema: - type: string - format: uuid +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid From 1da45e96b1dc19400c3b209c8a18d78234b019c4 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 08:17:50 +0530 Subject: [PATCH 108/121] Fix test related to line ending 2 --- tests/spec/PathTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 9d2b0727..3587e699 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -236,9 +236,9 @@ public function testPathParametersAreArrays() } elseif ($majorVersion == 5) { $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; } - if (stripos(PHP_OS, 'WIN') === 0) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6-windows-lf.yml"; - } +// if (stripos(PHP_OS, 'WIN') === 0) { +//// $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6-windows-lf.yml"; +// } $this->assertFileEquals(dirname(__DIR__) . $expected, dirname(__DIR__) . $dirSep.'compiled.yml'); unlink(dirname(__DIR__) . '/compiled.yml'); From c7a965ff93bdc5833a13e056489ebabd6de3e701 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 08:27:59 +0530 Subject: [PATCH 109/121] Fix test related to line ending 3 --- .../155/compiled-symfony-6-windows-lf.yml | 256 +++++++++--------- tests/data/issue/155/compiled-symfony-6.yml | 256 +++++++++--------- tests/data/issue/155/compiled-symfony-7.yml | 256 +++++++++--------- 3 files changed, 384 insertions(+), 384 deletions(-) diff --git a/tests/data/issue/155/compiled-symfony-6-windows-lf.yml b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml index e1774005..70aa7317 100644 --- a/tests/data/issue/155/compiled-symfony-6-windows-lf.yml +++ b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml @@ -1,128 +1,128 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: 'User''s ID' - required: true - schema: - type: string - format: uuid +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid diff --git a/tests/data/issue/155/compiled-symfony-6.yml b/tests/data/issue/155/compiled-symfony-6.yml index e1774005..70aa7317 100644 --- a/tests/data/issue/155/compiled-symfony-6.yml +++ b/tests/data/issue/155/compiled-symfony-6.yml @@ -1,128 +1,128 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: 'User''s ID' - required: true - schema: - type: string - format: uuid +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid diff --git a/tests/data/issue/155/compiled-symfony-7.yml b/tests/data/issue/155/compiled-symfony-7.yml index e7a45025..1f4921b0 100644 --- a/tests/data/issue/155/compiled-symfony-7.yml +++ b/tests/data/issue/155/compiled-symfony-7.yml @@ -1,128 +1,128 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: "User's ID" - required: true - schema: - type: string - format: uuid +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: "User's ID" + required: true + schema: + type: string + format: uuid From 6947e2480fc5cb1fb1c7e2ee9c066bf0da9032ed Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 08:33:27 +0530 Subject: [PATCH 110/121] Revert "Fix test related to line ending 3" This reverts commit c7a965ff93bdc5833a13e056489ebabd6de3e701. --- .../155/compiled-symfony-6-windows-lf.yml | 256 +++++++++--------- tests/data/issue/155/compiled-symfony-6.yml | 256 +++++++++--------- tests/data/issue/155/compiled-symfony-7.yml | 256 +++++++++--------- 3 files changed, 384 insertions(+), 384 deletions(-) diff --git a/tests/data/issue/155/compiled-symfony-6-windows-lf.yml b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml index 70aa7317..e1774005 100644 --- a/tests/data/issue/155/compiled-symfony-6-windows-lf.yml +++ b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml @@ -1,128 +1,128 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: 'User''s ID' - required: true - schema: - type: string - format: uuid +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid diff --git a/tests/data/issue/155/compiled-symfony-6.yml b/tests/data/issue/155/compiled-symfony-6.yml index 70aa7317..e1774005 100644 --- a/tests/data/issue/155/compiled-symfony-6.yml +++ b/tests/data/issue/155/compiled-symfony-6.yml @@ -1,128 +1,128 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: 'User''s ID' - required: true - schema: - type: string - format: uuid +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: 'User''s ID' + required: true + schema: + type: string + format: uuid diff --git a/tests/data/issue/155/compiled-symfony-7.yml b/tests/data/issue/155/compiled-symfony-7.yml index 1f4921b0..e7a45025 100644 --- a/tests/data/issue/155/compiled-symfony-7.yml +++ b/tests/data/issue/155/compiled-symfony-7.yml @@ -1,128 +1,128 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: "User's ID" - required: true - schema: - type: string - format: uuid +openapi: 3.0.0 +info: + title: 'Test REST API' + description: 'Specifications for the Test REST API.' + contact: + name: bplainia + email: bplainia@lhespotlight.org + version: '2021-05-18' +servers: + - + url: 'http://localhost:8000' + description: Test +paths: + '/v1/organizations/{organizationId}/user': + post: + tags: + - pets + summary: 'Creates a user' + requestBody: + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + required: true + responses: + '201': + description: Created + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + '/v1/organizations/{organizationId}/user/{id}': + get: + summary: 'Gets a user' + responses: + '200': + description: 'A bar' + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + id: + type: string + format: uuid + name: + type: string + '400': + description: 'Bad Request' + '403': + description: Forbidden + '404': + description: 'Not Found' + security: + - + BearerAuth: [] + parameters: + - + name: api-version + in: header + description: 'The API version' + required: false + schema: + type: string + format: date + example: '2021-05-18' + - + name: organizationId + in: path + description: 'The Organization ID' + required: true + schema: + type: string + format: uuid + - + name: id + in: path + description: "User's ID" + required: true + schema: + type: string + format: uuid From 20016f2234fee4cdc0fe1b8d766a4eeddfb766ef Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 09:26:09 +0530 Subject: [PATCH 111/121] Check --- tests/spec/PathTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 3587e699..d0a71c4e 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -240,7 +240,7 @@ public function testPathParametersAreArrays() //// $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6-windows-lf.yml"; // } - $this->assertFileEquals(dirname(__DIR__) . $expected, dirname(__DIR__) . $dirSep.'compiled.yml'); + $this->assertFileEquals(dirname(__DIR__) . $dirSep.'compiled.yml', dirname(__DIR__) . $expected); unlink(dirname(__DIR__) . '/compiled.yml'); } From f4628b09d89df4b7bbd8ae927f28374af2903781 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 13:29:41 +0530 Subject: [PATCH 112/121] Fix line ending issue in Windows - 4 --- tests/spec/PathTest.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index d0a71c4e..e853c8d8 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -222,26 +222,29 @@ public function testPathParametersAreArrays() $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); $this->assertEquals('id', $userIdPath->parameters[2]->name); $dirSep = DIRECTORY_SEPARATOR; - shell_exec('php '.dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . dirname(__DIR__) . $dirSep.'/compiled.yml'); + $output = dirname(__DIR__) . $dirSep . 'compiled.yml'; + shell_exec('php ' . dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . $output); - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-7.yml"; + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-7.yml"; $version = static::symfonyYamlVersion(); $majorVersion = explode('.', $version)[0]; if ($majorVersion == 6) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6.yml"; if (version_compare(PHP_VERSION, '8.1', '>=') && version_compare($version, '6.0.0', '!=')) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-7.yml"; + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-7.yml"; } } elseif ($majorVersion == 5) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6.yml"; + $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6.yml"; + } + if (stripos(PHP_OS, 'WIN') === 0) { +// $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6-windows-lf.yml"; + ; + file_put_contents($output, preg_replace('~\R~', "\n", file_get_contents($output))); } -// if (stripos(PHP_OS, 'WIN') === 0) { -//// $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155/compiled-symfony-6-windows-lf.yml"; -// } - $this->assertFileEquals(dirname(__DIR__) . $dirSep.'compiled.yml', dirname(__DIR__) . $expected); - unlink(dirname(__DIR__) . '/compiled.yml'); + $this->assertFileEquals($output, dirname(__DIR__) . $expected); + unlink($output); } public static function symfonyYamlVersion() From 8a41d7431b287af2f6ed18e5483aae44342bd56f Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 13:58:42 +0530 Subject: [PATCH 113/121] Fix line ending issue in Windows - 5 --- tests/spec/PathTest.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index e853c8d8..5882f5c4 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -225,25 +225,28 @@ public function testPathParametersAreArrays() $output = dirname(__DIR__) . $dirSep . 'compiled.yml'; shell_exec('php ' . dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . $output); - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-7.yml"; + $baseExpected = dirname(__DIR__)."{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}"; + $expected = $baseExpected.'compiled-symfony-7.yml'; $version = static::symfonyYamlVersion(); $majorVersion = explode('.', $version)[0]; if ($majorVersion == 6) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6.yml"; + $expected = $baseExpected."compiled-symfony-6.yml"; if (version_compare(PHP_VERSION, '8.1', '>=') && version_compare($version, '6.0.0', '!=')) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-7.yml"; + $expected = $baseExpected."compiled-symfony-7.yml"; } } elseif ($majorVersion == 5) { - $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6.yml"; + $expected = $baseExpected."compiled-symfony-6.yml"; } if (stripos(PHP_OS, 'WIN') === 0) { + // $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6-windows-lf.yml"; ; file_put_contents($output, preg_replace('~\R~', "\n", file_get_contents($output))); + file_put_contents($expected, preg_replace('~\R~', "\n", file_get_contents($expected))); } - $this->assertFileEquals($output, dirname(__DIR__) . $expected); + $this->assertFileEquals($output, $expected); unlink($output); } From ebeffc6de32ff9bede72fbc042e401ff7ed2146c Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 14:07:21 +0530 Subject: [PATCH 114/121] Cleanup --- tests/spec/PathTest.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 5882f5c4..cb831144 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -221,6 +221,7 @@ public function testPathParametersAreArrays() $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[0]); $this->assertInstanceOf(\cebe\openapi\spec\Parameter::class, $userIdPath->parameters[1]); $this->assertEquals('id', $userIdPath->parameters[2]->name); + $dirSep = DIRECTORY_SEPARATOR; $output = dirname(__DIR__) . $dirSep . 'compiled.yml'; shell_exec('php ' . dirname(__DIR__, 2) . "{$dirSep}bin{$dirSep}php-openapi inline " . $file . ' ' . $output); @@ -238,10 +239,7 @@ public function testPathParametersAreArrays() } elseif ($majorVersion == 5) { $expected = $baseExpected."compiled-symfony-6.yml"; } - if (stripos(PHP_OS, 'WIN') === 0) { - -// $expected = "{$dirSep}data{$dirSep}issue{$dirSep}155{$dirSep}compiled-symfony-6-windows-lf.yml"; - ; + if (stripos(PHP_OS, 'WIN') === 0) { # fixes https://github.com/cebe/php-openapi/actions/runs/14808968938/job/41581244210 file_put_contents($output, preg_replace('~\R~', "\n", file_get_contents($output))); file_put_contents($expected, preg_replace('~\R~', "\n", file_get_contents($expected))); } From 50fc31e6a62368cd34f617f7b5f042a82775169d Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 14:14:46 +0530 Subject: [PATCH 115/121] Change visibility --- tests/spec/PathTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index cb831144..196684d6 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -248,7 +248,7 @@ public function testPathParametersAreArrays() unlink($output); } - public static function symfonyYamlVersion() + protected static function symfonyYamlVersion() { $package = 'symfony/yaml'; $installed = json_decode(file_get_contents(__DIR__ . '/../../composer.lock'), true); From a38d47e1c5973978ebab8414ba0b7e0721015c1b Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 14:38:07 +0530 Subject: [PATCH 116/121] Test --- tests/spec/PathTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 196684d6..8d3dc7f8 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -240,7 +240,7 @@ public function testPathParametersAreArrays() $expected = $baseExpected."compiled-symfony-6.yml"; } if (stripos(PHP_OS, 'WIN') === 0) { # fixes https://github.com/cebe/php-openapi/actions/runs/14808968938/job/41581244210 - file_put_contents($output, preg_replace('~\R~', "\n", file_get_contents($output))); +// file_put_contents($output, preg_replace('~\R~', "\n", file_get_contents($output))); file_put_contents($expected, preg_replace('~\R~', "\n", file_get_contents($expected))); } From eeb37f0d96245a2b1dd2c8be1af43a41d43b10ca Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Sat, 3 May 2025 14:49:23 +0530 Subject: [PATCH 117/121] Cleanup --- .../155/compiled-symfony-6-windows-lf.yml | 128 ------------------ tests/spec/PathTest.php | 3 +- 2 files changed, 1 insertion(+), 130 deletions(-) delete mode 100644 tests/data/issue/155/compiled-symfony-6-windows-lf.yml diff --git a/tests/data/issue/155/compiled-symfony-6-windows-lf.yml b/tests/data/issue/155/compiled-symfony-6-windows-lf.yml deleted file mode 100644 index e1774005..00000000 --- a/tests/data/issue/155/compiled-symfony-6-windows-lf.yml +++ /dev/null @@ -1,128 +0,0 @@ -openapi: 3.0.0 -info: - title: 'Test REST API' - description: 'Specifications for the Test REST API.' - contact: - name: bplainia - email: bplainia@lhespotlight.org - version: '2021-05-18' -servers: - - - url: 'http://localhost:8000' - description: Test -paths: - '/v1/organizations/{organizationId}/user': - post: - tags: - - pets - summary: 'Creates a user' - requestBody: - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - required: true - responses: - '201': - description: Created - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - '/v1/organizations/{organizationId}/user/{id}': - get: - summary: 'Gets a user' - responses: - '200': - description: 'A bar' - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - id: - type: string - format: uuid - name: - type: string - '400': - description: 'Bad Request' - '403': - description: Forbidden - '404': - description: 'Not Found' - security: - - - BearerAuth: [] - parameters: - - - name: api-version - in: header - description: 'The API version' - required: false - schema: - type: string - format: date - example: '2021-05-18' - - - name: organizationId - in: path - description: 'The Organization ID' - required: true - schema: - type: string - format: uuid - - - name: id - in: path - description: 'User''s ID' - required: true - schema: - type: string - format: uuid diff --git a/tests/spec/PathTest.php b/tests/spec/PathTest.php index 8d3dc7f8..2d47e3e7 100644 --- a/tests/spec/PathTest.php +++ b/tests/spec/PathTest.php @@ -240,8 +240,7 @@ public function testPathParametersAreArrays() $expected = $baseExpected."compiled-symfony-6.yml"; } if (stripos(PHP_OS, 'WIN') === 0) { # fixes https://github.com/cebe/php-openapi/actions/runs/14808968938/job/41581244210 -// file_put_contents($output, preg_replace('~\R~', "\n", file_get_contents($output))); - file_put_contents($expected, preg_replace('~\R~', "\n", file_get_contents($expected))); + file_put_contents($expected, preg_replace('~\R~', "\n", file_get_contents($expected))); # not an ideal solution, can be refactored } $this->assertFileEquals($output, $expected); From 2b26ea1aa33e478f55a3e717f8eec7a669870fe6 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Fri, 22 Jul 2022 22:41:35 +0200 Subject: [PATCH 118/121] Added failing test for #164 --- Makefile | 2 +- tests/ReferenceContextTest.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index add949a6..7d9358f0 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ fix-style: php-cs-fixer.phar cli: docker-compose run --rm php bash -install: +install: composer.json package.json $(DOCKER_PHP) composer install --prefer-dist --no-interaction --no-progress --ansi $(DOCKER_NODE) yarn install diff --git a/tests/ReferenceContextTest.php b/tests/ReferenceContextTest.php index b06eb5fc..40e65baf 100644 --- a/tests/ReferenceContextTest.php +++ b/tests/ReferenceContextTest.php @@ -179,6 +179,14 @@ public function normalizeUriProvider() '/var/www/api/../definitions.yaml', 'file:///var/www/definitions.yaml', ], + [ + '/var/www/api/schema/../../definitions.yaml', + 'file:///var/www/definitions.yaml', + ], + [ + '/var/www/api/schema/./../definitions.yaml', + 'file:///var/www/api/definitions.yaml', + ], [ '/var/www/api/../definitions.yaml#/components/Pet', 'file:///var/www/definitions.yaml#/components/Pet', From 705e08275d1c9d9eef1622e026720f5f98d13885 Mon Sep 17 00:00:00 2001 From: Arinzechukwu Date: Fri, 28 Jul 2023 16:49:47 +0100 Subject: [PATCH 119/121] Fixed issues with relative path reference parsing --- src/ReferenceContext.php | 16 ++++++++++++---- tests/ReferenceContextTest.php | 6 +++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/ReferenceContext.php b/src/ReferenceContext.php index bde0a964..302e00ce 100644 --- a/src/ReferenceContext.php +++ b/src/ReferenceContext.php @@ -121,10 +121,18 @@ private function reduceDots($path) unset($parts[$i]); continue; } - if ($i > 0 && $parts[$i] === '..' && $parts[$i - $parentOffset] !== '..') { - unset($parts[$i - $parentOffset]); - unset($parts[$i]); - $parentOffset += 2; + + if ($i > 0 && $parts[$i] === '..') { + $parent = $i - $parentOffset; + //Make sure parent exists, if not, check the next parent etc + while($parent >= 0 && empty($parts[$parent])){ + $parent--; + } + //Confirm parent is valid + if(!empty($parts[$parent]) && $parts[$parent] !== '..'){ + unset($parts[$parent]); + unset($parts[$i]); + } } } return '/'.implode('/', $parts); diff --git a/tests/ReferenceContextTest.php b/tests/ReferenceContextTest.php index 40e65baf..bd450bc5 100644 --- a/tests/ReferenceContextTest.php +++ b/tests/ReferenceContextTest.php @@ -183,10 +183,14 @@ public function normalizeUriProvider() '/var/www/api/schema/../../definitions.yaml', 'file:///var/www/definitions.yaml', ], + [ + '/var/www/api/schema/./../data/./../definitions.yaml', + 'file:///var/www/api/definitions.yaml', + ], [ '/var/www/api/schema/./../definitions.yaml', 'file:///var/www/api/definitions.yaml', - ], + ], [ '/var/www/api/../definitions.yaml#/components/Pet', 'file:///var/www/definitions.yaml#/components/Pet', From bbc57204ca2055fd5f86fbf148b97ea47e6dd63c Mon Sep 17 00:00:00 2001 From: Arinzechukwu Date: Mon, 31 Jul 2023 15:06:26 +0100 Subject: [PATCH 120/121] Fixed issues with reducing url dots --- src/ReferenceContext.php | 2 +- tests/ReferenceContextTest.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ReferenceContext.php b/src/ReferenceContext.php index 302e00ce..6c3a4f18 100644 --- a/src/ReferenceContext.php +++ b/src/ReferenceContext.php @@ -131,8 +131,8 @@ private function reduceDots($path) //Confirm parent is valid if(!empty($parts[$parent]) && $parts[$parent] !== '..'){ unset($parts[$parent]); - unset($parts[$i]); } + unset($parts[$i]); } } return '/'.implode('/', $parts); diff --git a/tests/ReferenceContextTest.php b/tests/ReferenceContextTest.php index bd450bc5..dad12c1f 100644 --- a/tests/ReferenceContextTest.php +++ b/tests/ReferenceContextTest.php @@ -179,6 +179,10 @@ public function normalizeUriProvider() '/var/www/api/../definitions.yaml', 'file:///var/www/definitions.yaml', ], + [ + '/./definitions.yaml', + 'file:///definitions.yaml', + ], [ '/var/www/api/schema/../../definitions.yaml', 'file:///var/www/definitions.yaml', From 893ab104be1f5dfe5a39766703f583584e43c6e1 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 7 May 2025 10:44:12 +0200 Subject: [PATCH 121/121] code style fixes --- src/ReferenceContext.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ReferenceContext.php b/src/ReferenceContext.php index 6c3a4f18..868ec920 100644 --- a/src/ReferenceContext.php +++ b/src/ReferenceContext.php @@ -125,11 +125,11 @@ private function reduceDots($path) if ($i > 0 && $parts[$i] === '..') { $parent = $i - $parentOffset; //Make sure parent exists, if not, check the next parent etc - while($parent >= 0 && empty($parts[$parent])){ - $parent--; + while ($parent >= 0 && empty($parts[$parent])) { + $parent--; } //Confirm parent is valid - if(!empty($parts[$parent]) && $parts[$parent] !== '..'){ + if (!empty($parts[$parent]) && $parts[$parent] !== '..') { unset($parts[$parent]); } unset($parts[$i]);