Files
windmill/backend/windmill-types/Cargo.toml
f3b31b18f5 fix(api): type /scripts/list response as ListableScript (#9577)
* fix(api): type /scripts/list response as ListableScript

GET /w/{workspace}/scripts/list is documented as returning the full Script
schema, but it actually returns a lighter object (Rust ListableScript) that
omits heavy fields like content, created_by, parent_hashes, deleted,
is_template and has_preprocessor. The OpenAPI docs — and the generated clients
— therefore over-promise fields that are never present at runtime.

Add an accurate ListableScript schema and point the /scripts/list response at
it. Regenerating the frontend client surfaced several consumers that were typed
against the full Script for list results; retype them to ListableScript. They
only use the lighter fields — full-script fields elsewhere come from separate
getScriptByPath/getScriptByHash fetches and are unchanged.

Addresses #5451

* fix: type /scripts/list as ListableScript matching the Rust struct, retype its consumers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: fail when ListableScript and its openapi schema drift apart

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 11:20:49 +01:00

32 lines
737 B
TOML

[package]
name = "windmill-types"
version.workspace = true
authors.workspace = true
edition.workspace = true
[lib]
name = "windmill_types"
path = "src/lib.rs"
# src/ has no doctests: remove this line before adding one, or cargo test never runs it.
doctest = false
[dependencies]
windmill-parser.workspace = true
serde.workspace = true
serde_json.workspace = true
chrono.workspace = true
uuid.workspace = true
rand.workspace = true
hex.workspace = true
anyhow.workspace = true
tracing.workspace = true
itertools.workspace = true
strum.workspace = true
bitflags.workspace = true
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
sqlx = { workspace = true, features = ["postgres"] }
[dev-dependencies]
serde_yml.workspace = true