Repository navigation
Conversation
- pass target_schema= instead of the ignored schema= (#215) - replace $defs/generated in DEFINITIONS_SECTION mode instead of merging - add offline regression tests through store_entity
) - collect templates from the meta category allOf chain, wiki order - pick the definitions section mode by CharacteristicType in the list - port @context reset and merge, and superseded root member removal - warn when a meta category schema is missing
Contributor
Release previewMerging this PR would release v2.8.3 (current: Changelog preview (truncated)## v2.8.3 (2026-11-05)
### Bug Fixes
- Follow properties and items when collecting category templates
([#220](https://github.com/OpenSemanticLab/osw-python/pull/220),
[`55e500e`](https://github.com/OpenSemanticLab/osw-python/commit/55e500efb896f0a3d6bde98409b3a6f43a652bdc))
- Keep the stored jsonschema when store_entity regenerates it
([`9b76a8f`](https://github.com/OpenSemanticLab/osw-python/commit/9b76a8fbeb813b34c4881b54d329e9e837b08f95))
- Select category templates from the schema allOf like the wiki
([#220](https://github.com/OpenSemanticLab/osw-python/pull/220),
[`9f606f4`](https://github.com/OpenSemanticLab/osw-python/commit/9f606f48fefd640cca48e6718f1a92eca118da6b))
### Documentation
- State which schema references the template walk follows
([#220](https://github.com/OpenSemanticLab/osw-python/pull/220),
[`799bc07`](https://github.com/OpenSemanticLab/osw-python/commit/799bc07952aac7e6ab579bc127c5cb3000710491))
Preview via python-semantic-release and conventional commits. |
…220) - walk properties and items after allOf, definitions and $defs - a referenced schema is walked at its first occurrence only - update the docstring
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #220
Related: #215
Depends on #216. This branch is based on the branch of that pull request, so the diff against
maincontains its commit until it is merged.Changes
store_entitycollects the category templates from theallOfchain of the meta category schemas, in the order of the wiki form editor, instead of walkingsubclass_of. The walk includes every entry ofpropertiesand theitemsof each property, afterallOf,oneOf,anyOf,definitionsand$defs. A referenced schema is walked only at its first occurrence.Category:OSWffe74f291d354037b318c422591c5023(CharacteristicType) is in that list, not by the model class of the entity.@contextblock, the merge of the generated@contextinto the first object block, and the removal of root members that the generated section defines.Rationale
Category:Categoryhas anallOfto CharacteristicType and nosubclass_of, so thesubclass_ofwalk never reached the CharacteristicType template. The wiki follows the schemaallOf.Tests
tests/test_store_entity_category_templates.py. It stores the afterjsondataof two saved Category pages (PhysicalItem and PhysicalItemType; the repository owner stated that they were saved unchanged through the form editor, which was not verified here) on top of the beforejsonschema, offline, and expects thejsonschemaof the after state. Both pages are equal to the form-editor result.propertiesanditems, the@contextreset, the removal of root members and the warning.tests/test_store_entity_keeps_jsonschema.pynow serves a meta category schema with anallOfto CharacteristicType where it expects the definitions section mode.Limits
/wiki/<title>?action=rawreference is followed only for category pages. For example/wiki/JsonSchema:Label?action=rawis not followed. ASpecial:SlotResolverreference is followed for any page.@contextreset, the@contextmerge and the removal of root members run only in definitions section mode.Categoryare unchanged:store_entitygenerates no schema there, the wiki does.