Closed
Description
Actual Behavior
I have the following paths:
openapi: 3.1.0
info:
title: My API
description: My API
version: 1.0.0
paths:
/customer:
post:
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: response.json
The "response.json" schema exists on the same level as the "api.yaml".
Then I use OpenAPI.from_file_path("apis/api.yaml")
. And it fails with:
referencing.exceptions.Unresolvable: response.json
So for some reason, response schema resolution always fails...
Expected Behavior
I expect response schemas to be looked up relative to the API specification file. The same they are looked up for requests (and which works for me).
Steps to Reproduce
- Create the following "api.yaml":
openapi: 3.1.0
info:
title: My API
description: My API
version: 1.0.0
paths:
/customer:
post:
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: response.json
- Create a "response.json" file with
{}
content. - Run the following code:
from openapi_core import OpenAPI
OpenAPI.from_file_path("api.yaml")
OpenAPI Core Version
0.19.2
OpenAPI Core Integration
flask
Affected Area(s)
dependencies, schema
References
No response
Anything else we need to know?
No response
Would you like to implement a fix?
None