Closed as not planned
Description
Hi!
I'm trying to build an OAPI definition where I split shared data into separate files. I'm only using json format as of now. One example would be doing something like this:
{
"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"
}
}
}
}
}
}
and the 401 file would contain the actual details:
"description": "401 response",
"content": {
"application/json": {
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
]
},
"example": {
"message": "Unauthenticated."
}
}
}
When attempting to do this, it seems this package formats the URI to become file://401.json
. This causes the parser to fail. The stack trace looks like this:
cebe\openapi\exceptions\UnresolvableReferenceException : Failed to resolve Reference './401.json' to cebe\openapi\spec\Response Object: file_get_contents(file:///401.json): Failed to open stream: No such file or directory
vendor/cebe/php-openapi/src/spec/Reference.php:220
vendor/cebe/php-openapi/src/spec/Responses.php:244
vendor/cebe/php-openapi/src/SpecBaseObject.php:410
vendor/cebe/php-openapi/src/SpecBaseObject.php:410
vendor/cebe/php-openapi/src/spec/PathItem.php:200
I'm on a Mac. Any ideas?
Metadata
Metadata
Assignees
Labels
No labels