Skip to content

Python schema validation - #150

Open
JPEWdev wants to merge 7 commits into
mainfrom
python-schema-validation
Open

Python schema validation#150
JPEWdev wants to merge 7 commits into
mainfrom
python-schema-validation

Conversation

@JPEWdev

@JPEWdev JPEWdev commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Changes the Python bindings to match the validation semantics of the other code bindings. This allows its test suite to use the common JSON schema validation tests that all the other bindings use. In addition, stubtest tests are added to ensure that the .pyi files stay in sync with .py

@JPEWdev
JPEWdev requested a review from bact August 28, 2026 14:42
@bact bact added this to the 1.4.0 milestone Sep 1, 2026
Implements the context checks that are present in the other language
bindings in python as well
Implements the same class resolution logic as is present in the other
language bindings.
It is useful to have the line numbers in the jinja file line up with the
line numbers in the generated file as much as possible (at least until
the block at then end with all the generated classes). Rework the way
the version information is generated by Jinja to make sure this is the
case.
Implements tracking the path for validation errors, and also raising
custom exceptions that capture the path. This matches the other bindings
and also helps when debugging errors
Unknown properties (in extensible classes) should still be valid IRIs.
Test should be added to enforce that they are not blank nodes and that
context is correctly expanded.
Now that Python conforms with the other code binding implementations,
run the entire JSON validation test suite instead of just a subset
Adds stubtest tests. This ensures that the .pyi files stay in sync with
the .py files. Several API are fixed to conform, and an ignore list is
provided for the rest (although these can be fixed at a later time).
@JPEWdev
JPEWdev force-pushed the python-schema-validation branch from 66b2b95 to 447d8ca Compare September 3, 2026 00:58
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/shacl2code/lang
  python.py
Project Total  

This report was generated by python-coverage-comment-action

@bact bact added the enhancement New feature or request label Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants