-
-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with nested self-referencing schemas #813
Labels
Comments
From a very quick look, I have the feeling you're comparing a schema class/instance and a name. Should it be something more like this? if resolve_schema_cls(value.nested).__name__ == schema_name: or perhaps even if resolve_schema_cls(value.nested) == resolve_schema_cls(schema): |
@lafrech thank you for the quick feedback! but sadly that didn't solve the issue, the ref_schema = self.spec.components.get_ref("schema", self.refs[schema_key])
KeyError: (<class 'api.insights.serializers.base.FilterSchema'>, None, frozenset(), frozenset(), frozenset(), False) These are some debug outputs:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have an issue with nested self-referencing schema,
The issue is with
FilterSchema
I have a helper method that converts Marshmallow Schema to an OpenApiJson object:
The
schema_name_resolver
as described in the docs should not returnNone
for Circular schemasBut it still complains:
And I'm sure that the
schema_name_resolver
is returning astring
when the schema is circularUsing a resolver as
lambda schema_class: None
will raise the error below which is understandable!I'm using:
The text was updated successfully, but these errors were encountered: