Skip to content

fix(GIT-1358): Fix extend-schema property visibility and allOf composition#1398

Merged
remko48 merged 6 commits into
developmentfrom
fix/GIT-1358/extend-schema-properties
May 1, 2026
Merged

fix(GIT-1358): Fix extend-schema property visibility and allOf composition#1398
remko48 merged 6 commits into
developmentfrom
fix/GIT-1358/extend-schema-properties

Conversation

@remko48
Copy link
Copy Markdown
Member

@remko48 remko48 commented May 1, 2026

Summary

Completes the extend-schema feature (GIT-1358) by migrating from the deprecated
extend field to JSON-Schema-standard allOf composition, and ensures that
properties inherited from parent schemas are visible throughout the UI wherever
objects are viewed, edited, or searched.

Changes

Schema type definitions (schema.types.ts, schema.ts)

  • Replaced the deprecated extend?: string field with three JSON Schema composition
    fields: allOf?: string[], oneOf?: string[], anyOf?: string[].
  • Added the three new fields to the Schema entity class so they survive
    new Schema(payload) construction and are not silently stripped before reaching
    the API.

Schema mapper (lib/Db/SchemaMapper.php)

  • Updated the PHP doc comment to remove the reference to the now-removed extend
    field, keeping the doc accurate with the three standard composition fields.

Edit schema modal (src/modals/schema/EditSchema.vue)

  • The "Extend schema" button now emits allOf: [parentId] instead of
    extend: parentId.
  • Added a computedInheritedProperties computed property that walks allOf
    references and merges the parent schema's properties. These are passed as
    inherited-properties to the form dialog so the editor can display parent
    properties alongside own ones.

View object modal (src/modals/object/ViewObject.vue)

  • The currentSchema computed property now merges inherited properties from all
    allOf parent schemas into the returned schema object, so the object form shows
    the full property set (own + inherited) rather than just the child's own
    (typically empty) properties.
  • On mounted and in the currentSchema watcher: when the active schema uses
    composition but has zero resolved properties (schema-list endpoint returns raw
    unresolved schemas), the code now automatically refetches the schema via the
    detail endpoint, which triggers the backend's resolveSchemaExtension and
    returns the fully merged schema. A guard prevents infinite re-fetching.

Schema store (src/store/modules/schema.js)

  • When saving a new schema (id is empty string), the id field is now omitted
    entirely from the request body so the backend unambiguously treats it as a
    create rather than an update with an empty id. This fixed the security/roles
    tab breaking on new schema creation.

Search sidebar (src/sidebars/search/SearchSideBar.vue)

  • Extracted a resolveInheritedProperties(schema) helper that merges allOf
    parent properties into a schema's own properties.
  • Used it in schemaOptions (schema picker) and in discoverFacets so facet
    filtering and column display respect inherited fields from extended schemas.

Search index view (src/views/search/SearchIndex.vue)

  • The normalizedSchema computed property now merges inherited properties from
    allOf parents before normalizing order values, ensuring extended schemas
    expose all columns in the search result table.

Behaviour after this fix

Scenario Before After
Create an extended schema Saved as extend: id, stripped by Schema entity Saved as allOf: [id], preserved end-to-end
Edit an extended schema Parent properties not visible in form Parent properties shown alongside own properties
View/add object on extended schema Form empty (no resolved properties) Form shows full merged property set
Search with extended schema Only child's own columns/facets shown Inherited columns and facets included
Create new schema, open security tab Request sent with id: "", causing backend error id omitted on create; security tab works correctly

rjzondervan and others added 6 commits April 30, 2026 11:32
Completes the extend → allOf migration so creating an extended schema,
saving it, and adding objects against it all work correctly.

schema.types.ts / EditSchema.vue / SchemaMapper.php (in-flight):
  Replace deprecated single-parent `extend?: string` with JSON-Schema-
  standard composition fields `allOf?/oneOf?/anyOf?: string[]`. Update
  the extend-schema button to emit `allOf: [parentId]` and clean the
  PHP doc comment that still referenced `extend`.

src/entities/schema/schema.ts:
  The TypeScript Schema entity dropped allOf/oneOf/anyOf in its
  constructor, so `setSchemaItem(new Schema(payload))` stripped the
  parent reference before it ever reached the API. Add the three fields
  to the class and copy them through.

src/modals/object/ViewObject.vue:
  When adding an object against a composed schema, the form was empty
  because `schemaStore.schemaItem` came from the schema list endpoint,
  which does not run resolveSchemaExtension and therefore returns empty
  `properties`. Refetch the active schema by id (mounted, and in the
  currentSchema watcher) when it has allOf/oneOf/anyOf but no resolved
  properties — the detail endpoint merges parent properties in. A
  guard on (composition refs && propsCount === 0) prevents recursion
  once the resolved version arrives.
@remko48 remko48 merged commit 6ff3781 into development May 1, 2026
16 of 19 checks passed
@remko48 remko48 deleted the fix/GIT-1358/extend-schema-properties branch May 1, 2026 13:18
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

Quality Report — ConductionNL/openregister @ 1a1177f

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 147/147
npm ✅ 598/598
PHPUnit
Newman
Playwright ⏭️

Quality workflow — 2026-05-01 19:21 UTC

Download the full PDF report from the workflow artifacts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants