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
Contributor
Release previewMerging this PR would release v2.8.3 (current: Changelog preview (truncated)## v2.8.3 (2026-10-16)
### Bug Fixes
- Keep the stored jsonschema when store_entity regenerates it
([`9b76a8f`](https://github.com/OpenSemanticLab/osw-python/commit/9b76a8fbeb813b34c4881b54d329e9e837b08f95))
Preview via python-semantic-release and conventional commits. |
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.
Closes #215
Changes
store_entitypasses the storedjsonschemaslot astarget_schema=. The old keywordschema=is not a field ofAggregateGeneratedSchemasParam, so the aggregation always started from{}and dropped the hand-written schema.jsonschemaslot starts from{}, as before.remove_generated_schema_section()insrc/osw/core.py. It removes$defs/generatedand theallOfentry{"$ref": "#/$defs/generated"}, asosl.util.postProcessPagein PageBot.js does.store_entitycalls it inDEFINITIONS_SECTIONmode (Characteristics) before the aggregation, so the generated section is replaced instead of merged. It is called only when template generation produced at least one generated schema, so a failed generation keeps the stored schema.Tests
New
tests/test_store_entity_keeps_jsonschema.py, 5 tests. They runstore_entitywithoffline=Trueand a fake site that serves the meta category, so no wiki is needed.$defsentries outside the generated section.requiredandtype, and$commentnames the meta category once.The first four tests failed on
mainbefore the fix. With only thetarget_schema=change, the stale-section test still failed atrequired.Local gate:
make checkpassed,make testreported 805 passed.Not in this PR
As noted in the issue,
resetGeneratedJsonLdContextandstripRootMembersSupersededByGeneratedfrom PageBot.js are not ported. In ROOT_LEVEL mode a root entry that a later template no longer produces stays in the schema.