mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
Проверка 09.02.2025
This commit is contained in:
@@ -2554,8 +2554,13 @@ def _get_all_json_refs(item: Any) -> set[JsonRef]:
|
||||
current = stack.pop()
|
||||
if isinstance(current, dict):
|
||||
for key, value in current.items():
|
||||
if key == 'examples':
|
||||
continue # skip examples, allow arbitrary values / refs
|
||||
if key == 'examples' and isinstance(value, list):
|
||||
# Skip examples that may contain arbitrary values and references
|
||||
# (e.g. `{"examples": [{"$ref": "..."}]}`). Note: checking for value
|
||||
# of type list is necessary to avoid skipping valid portions of the schema,
|
||||
# for instance when "examples" is used as a property key. A more robust solution
|
||||
# could be found, but would require more advanced JSON Schema parsing logic.
|
||||
continue
|
||||
if key == '$ref' and isinstance(value, str):
|
||||
refs.add(JsonRef(value))
|
||||
elif isinstance(value, dict):
|
||||
|
Reference in New Issue
Block a user