Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- SyntaxWarning during installation: `datacontract/lint/resolve.py:72: SyntaxWarning: 'return' in a 'finally' block return except_message` is handled properly

## [1.0.13] - 2026-07-14

### Added
Expand Down
7 changes: 4 additions & 3 deletions datacontract/lint/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ class _SafeLoaderNoTimestamp(yaml.SafeLoader):


def _resolve_jsonschema_compliance_error_message_path(yaml_str, message):
except_message = message

try:
matches = re.findall(r"\[(\d+)\]", message)
schema_index = matches[0] if len(matches) > 0 else None
property_index = matches[1] if len(matches) > 1 else None
except_message = message
if schema_index is not None and "schema" in yaml_str and int(schema_index) < len(yaml_str["schema"]):
except_message = except_message.replace(
f"schema[{schema_index}]", f"schema.{yaml_str['schema'][int(schema_index)]['name']}"
Expand All @@ -68,8 +69,8 @@ def _resolve_jsonschema_compliance_error_message_path(yaml_str, message):
except Exception:
logging.warning("YAML doesn't conform to JSON schema. Could not resolve indexed schema or property names.")
except_message = message
finally:
return except_message

return except_message


def resolve_data_contract_dict(
Expand Down