Skip to main content

describeSchemaChange

Render one entry of a SchemaBreakingChangeError's changes[] as a line a human can read.

import { describeSchemaChange } from '@conduction/nextcloud-vue'
import { translate as t } from '@nextcloud/l10n'

describeSchemaChange(
{ property: 'barn', kind: 'type_changed', old: 'string', new: 'object' },
t,
)
// → "barn: type changed (from string to object)"
ParamTypeDescription
changeobjectOne change descriptor from the server.
translateFunctionA t-style translator (app, text, vars) => string. Optional.

Lives in the library so every schema editor words the same refusal identically, rather than each app inventing its own phrasing for the same server response.