Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/IssueTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

use cebe\openapi\Reader;

class IssueTest extends \PHPUnit\Framework\TestCase
{
// https://github.com/cebe/php-openapi/issues/175
public function test175UnableToReferenceOtherLocalJsonFile()
{
$openapi = Reader::readFromJsonFile(__DIR__.'/data/issue/175/spec.json');
$this->assertInstanceOf(\cebe\openapi\SpecObjectInterface::class, $openapi);
}
}
20 changes: 20 additions & 0 deletions tests/data/issue/175/401.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"description": "401 response",
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
]
},
"example": {
"message": "Unauthenticated."
}
}
}
}
20 changes: 20 additions & 0 deletions tests/data/issue/175/spec.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
}
}
Loading