4.4 KiB
StackStorm-Style Parameter Schema Migration
Date: 2026-02-22
Summary
Migrated param_schema format from standard JSON Schema to StackStorm-style flat parameter maps with required and secret inlined per-parameter. This makes parameter definitions more readable and eliminates the clunky top-level required array pattern from JSON Schema.
Format Change
Before (JSON Schema)
parameters:
type: object
properties:
url:
type: string
description: "Target URL"
token:
type: string
secret: true
required:
- url
After (StackStorm-style)
parameters:
url:
type: string
description: "Target URL"
required: true
token:
type: string
secret: true
The type: object / properties: wrapper is removed. required moves from a top-level array to an inline boolean per-parameter. secret was already inline and remains unchanged.
Scope
param_schema(action, trigger, sensor, workflow parameters): Converted to StackStorm-styleout_schema(output schemas): Left as standard JSON Schema —required/secretare not meaningful for outputs- Database: No migration needed — columns are JSONB, the JSON shape just changes
- Backward compatibility: Web UI
extractProperties()handles both formats during transition
Files Modified
Pack YAML Files (13 files)
packs/core/actions/echo.yamlpacks/core/actions/sleep.yamlpacks/core/actions/noop.yamlpacks/core/actions/http_request.yamlpacks/core/actions/download_packs.yamlpacks/core/actions/register_packs.yamlpacks/core/actions/build_pack_envs.yamlpacks/core/actions/get_pack_dependencies.yamlpacks/core/triggers/intervaltimer.yamlpacks/core/triggers/crontimer.yamlpacks/core/triggers/datetimetimer.yamlpacks/core/workflows/install_packs.yamlpacks/examples/actions/list_example.yaml
Web UI (7 files)
web/src/components/common/ParamSchemaForm.tsx— NewParamSchemaPropertyinterface with inlinerequired/secret/position, new exportedextractProperties()utility, updatedvalidateParamSchema()logicweb/src/components/common/ParamSchemaDisplay.tsx— Imports sharedextractProperties, removed duplicate type definitionsweb/src/components/common/ExecuteActionModal.tsx— Uses sharedextractPropertiesfor parameter initializationweb/src/components/common/SchemaBuilder.tsx— Produces StackStorm-style flat format, added Secret checkbox, handles both formats on inputweb/src/components/forms/TriggerForm.tsx— Updated empty-schema check for flat formatweb/src/pages/actions/ActionsPage.tsx— UsesextractProperties, added Secret badgesweb/src/pages/triggers/TriggersPage.tsx— UsesextractProperties, added Secret badges
API DTOs (3 files)
crates/api/src/dto/action.rs— Updated OpenAPI examples and doc commentscrates/api/src/dto/trigger.rs— Updated OpenAPI examples and doc commentscrates/api/src/dto/workflow.rs— Updated OpenAPI examples and doc comments
Documentation
AGENTS.md— Added Parameter Schema Format documentation in Pack File Loading section
Key Design Decisions
-
Shared
extractProperties()utility: Single exported function inParamSchemaForm.tsxhandles both StackStorm-style and legacy JSON Schema formats. All consumers import from one place instead of duplicating logic. -
Backward compatibility in Web UI: The
extractProperties()function detects the old format (presence oftype: "object"+propertieswrapper) and normalizes it to the flat format, merging the top-levelrequiredarray into per-parameterrequired: trueflags. This means existing database records in the old format will still render correctly. -
No Rust model changes needed:
param_schemais stored asOption<JsonValue>(aliased asJsonSchema). The Rust code doesn't deeply inspect the schema structure — it passes it through as opaque JSONB. The format change is transparent to the backend. -
Pack loaders unchanged: Both
loader.rsandload_core_pack.pyreaddata.get("parameters")and serialize it to JSONB as-is. Since we changed the YAML format, the stored format automatically changes to match.
Verification
- Rust:
cargo check --all-targets --workspace— zero warnings - Rust:
cargo test --workspace --lib— 82 tests passed - TypeScript:
npx tsc --noEmit— clean - Vite:
npx vite build— successful production build