Skip to content

Commit 3008e66

Browse files
committed
Merge branch 'master' of github.com:SOHELAHMED7/php-openapi into 84-validate-returns-true-with-wrong-top-level-elements
2 parents f8303c5 + 4c670b0 commit 3008e66

File tree

5 files changed

+66
-13
lines changed

5 files changed

+66
-13
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"php": ">=7.1.0",
2222
"ext-json": "*",
2323
"symfony/yaml": "^3.4 || ^4 || ^5 || ^6 || ^7.0",
24-
"justinrainbow/json-schema": "^5.2"
24+
"justinrainbow/json-schema": "^5.2 || ^6.0"
2525
},
2626
"require-dev": {
2727
"cebe/indent": "*",
@@ -30,7 +30,7 @@
3030
"mermade/openapi3-examples": "1.0.0",
3131
"apis-guru/openapi-directory": "1.0.0",
3232
"nexmo/api-specification": "1.0.0",
33-
"phpstan/phpstan": "^0.12.0"
33+
"phpstan/phpstan": "^0.12.0 || ^1.9"
3434
},
3535
"conflict": {
3636
"symfony/yaml": "3.4.0 - 3.4.4 || 4.0.0 - 4.4.17 || 5.0.0 - 5.1.9 || 5.2.0"

tests/IssueTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
use cebe\openapi\Reader;
4+
5+
class IssueTest extends \PHPUnit\Framework\TestCase
6+
{
7+
// https://github.com/cebe/php-openapi/issues/175
8+
public function test175UnableToReferenceOtherLocalJsonFile()
9+
{
10+
$openapi = Reader::readFromJsonFile(__DIR__.'/data/issue/175/spec.json');
11+
$this->assertInstanceOf(\cebe\openapi\SpecObjectInterface::class, $openapi);
12+
}
13+
}

tests/data/issue/175/401.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"description": "401 response",
3+
"content": {
4+
"application/json": {
5+
"schema": {
6+
"properties": {
7+
"message": {
8+
"type": "string"
9+
}
10+
},
11+
"required": [
12+
"message"
13+
]
14+
},
15+
"example": {
16+
"message": "Unauthenticated."
17+
}
18+
}
19+
}
20+
}

tests/data/issue/175/spec.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"title": "My API",
5+
"version": "1, 2"
6+
},
7+
"paths": {
8+
"/v1/users/profile": {
9+
"get": {
10+
"operationId": "V1GetUserProfile",
11+
"summary": "Returns the user profile",
12+
"responses": {
13+
"401": {
14+
"$ref": "./401.json"
15+
}
16+
}
17+
}
18+
}
19+
}
20+
}

yarn.lock

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
js-tokens "^4.0.0"
2525

2626
"@babel/runtime@^7.0.0", "@babel/runtime@^7.12.5":
27-
version "7.17.2"
28-
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.2.tgz#66f68591605e59da47523c631416b18508779941"
29-
integrity sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw==
27+
version "7.27.0"
28+
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.27.0.tgz#fbee7cf97c709518ecc1f590984481d5460d4762"
29+
integrity sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==
3030
dependencies:
31-
regenerator-runtime "^0.13.4"
31+
regenerator-runtime "^0.14.0"
3232

3333
"@cloudflare/json-schema-walker@^0.1.1":
3434
version "0.1.1"
@@ -1144,9 +1144,9 @@ polished@^3.0.3:
11441144
"@babel/runtime" "^7.12.5"
11451145

11461146
prismjs@^1.15.0:
1147-
version "1.27.0"
1148-
resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.27.0.tgz#bb6ee3138a0b438a3653dd4d6ce0cc6510a45057"
1149-
integrity sha512-t13BGPUlFDR7wRB5kQDG4jjl7XeuH6jbJGt11JHPL96qwsEHNX2+68tFXqc1/k+/jALsbSWJKUOT/hcYAZ5LkA==
1147+
version "1.30.0"
1148+
resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.30.0.tgz#d9709969d9d4e16403f6f348c63553b19f0975a9"
1149+
integrity sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==
11501150

11511151
process@^0.11.10:
11521152
version "0.11.10"
@@ -1273,10 +1273,10 @@ reftools@^1.1.0, reftools@^1.1.9:
12731273
resolved "https://registry.yarnpkg.com/reftools/-/reftools-1.1.9.tgz#e16e19f662ccd4648605312c06d34e5da3a2b77e"
12741274
integrity sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w==
12751275

1276-
regenerator-runtime@^0.13.4:
1277-
version "0.13.9"
1278-
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52"
1279-
integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==
1276+
regenerator-runtime@^0.14.0:
1277+
version "0.14.1"
1278+
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f"
1279+
integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==
12801280

12811281
require-directory@^2.1.1:
12821282
version "2.1.1"

0 commit comments

Comments
 (0)