Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Need of recursive properties check in validation

Open
#372 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

Start in validation/keywords.py at SchemaValidator and trace how nested schemas, allOf, and properties are currently validated. Done means recursive properties in nested schemas are detected, including schemas nested through allOf, with validation behavior covering the reported API case.

Written by the indexing model from the issue text.

Description

Some APIs contain nested schemas, and the current version of 0.7.1 openapi-spec-validator is unable catch the recursive properties. Below is an example of what can be achieved with a little tweak in the class SchemaValidator validation/keywords.py.

 nested_properties = []
        if "allOf" in schema:
            all_of = schema / "allOf"
            while True:
              for inner_schema in all_of:
                  yield from self(
                      inner_schema,
                      require_properties=False,
                  )
                  if "properties" not in inner_schema:
                      continue
                  inner_schema_props = inner_schema / "properties"
                  inner_schema_props_keys = inner_schema_props.keys()
                  nested_properties += list(inner_schema_props_keys)
              if "allOf" not in inner_schema:
                 break
              all_of = inner_schema / "allOf"
Dominant language
Python
Stars
409
Forks
73
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-openapi/openapi-spec-validator

All issues in python-openapi/openapi-spec-validator

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.