Skip to content

v0.11.0 — Step configuration schema

Choose a tag to compare

@kevinbalicot kevinbalicot released this 06 Aug 13:26
· 11 commits to main since this release

What's new

configurationSchema on #[AsExecutableStep]

Steps can now declare the expected shape of their configuration, in addition to the existing human-readable configurationDescription:

#[AsExecutableStep(
    code: 'etl.loader.csv_file',
    configurationSchema: [
        'destination' => ['type' => 'string'],
        'withHeader'  => ['type' => 'boolean'],
    ],
)]

getConfigurationSchema() returns it verbatim, and it is now enforced at runtime: whenever setConfiguration() is called (e.g. by the pipeline runner), the given configuration is validated against the schema and an InvalidStepConfigurationException is thrown on mismatch.

Schema DSL, per field:

Key Description
type One or more of string, number, integer, boolean, array, object, null, separated by |
required (optional, bool) throws if the field is absent from the configuration
properties (optional, with type: 'array') nested schema validated against each element
schema (optional, with type: 'object') nested schema validated against the value itself

All 9 built-in steps (CSV/JSON/XML extractors and loaders, filter, data mapping, console command executor) now declare their configurationSchema.

This is purely additive — no existing public signatures change. See the README for the full DSL and an example.

Full changelog

v0.10.0...v0.11.0