You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Including the OpenAPI spec itself in the spec causes Schemathesis to run forever in the resolve_all() step of the schema parsing. This would be a use case if you supply your own API spec through your API, and note the OpenAPI spec as the schema.
To Reproduce
Steps to reproduce the behavior:
Use the API spec below.
Read the file with schema = schemathesis.from_path(file_path)
Accessing e.g. schema["/"] will cause schemathesis to hang forever in the resolve_all() step, consuming more and more memory. I let it run up to at least 30G of memory consumed with no sign of continuing.
{openapi: 3.0.3info:
version: 1.0.0title: My APIdescription: My HTTP interface.paths:
# Get this specification/:
get:
summary: OpenAPI description (this document)tags:
- IntrospectionoperationId: getApiDescriptionresponses:
"200":
description: OKcontent:
application/openapi+json:
schema:
$ref: "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/aa91a19c43f8a12c02efa42d64794e396473f3b1/schemas/v3.0/schema.json#"}
Expected behavior
I would expect schemathesis to be able to parse the OpenAPI spec itself.
Environment (please complete the following information):
OS: Ubuntu
Python version: 3.10
Schemathesis version: 3.18.3
Spec version: 3.0.3
Additional context
It worked on Schemathesis 3.15.6.
The text was updated successfully, but these errors were encountered:
Indeed, it is bad behavior - I'll investigate what's the root cause. In some cases, we fallback to inlining schemas up to some recursion level as hypothesis-jsonschema does not yet support recursive references. Implementing it properly is on my todo list for the next following months (as it is needed to support Open API 3.1 properly), so implementing this will solve one of the possible causes.
Checklist
Describe the bug
Including the OpenAPI spec itself in the spec causes Schemathesis to run forever in the resolve_all() step of the schema parsing. This would be a use case if you supply your own API spec through your API, and note the OpenAPI spec as the schema.
To Reproduce
Steps to reproduce the behavior:
schema = schemathesis.from_path(file_path)
schema["/"]
will cause schemathesis to hang forever in the resolve_all() step, consuming more and more memory. I let it run up to at least 30G of memory consumed with no sign of continuing.Expected behavior
I would expect schemathesis to be able to parse the OpenAPI spec itself.
Environment (please complete the following information):
Additional context
It worked on Schemathesis 3.15.6.
The text was updated successfully, but these errors were encountered: