mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-19 00:02:03 +00:00
fix input transforms for resource and variable
This commit is contained in:
@@ -1321,12 +1321,28 @@ paths:
|
||||
- $ref: "#/components/parameters/Path"
|
||||
responses:
|
||||
"200":
|
||||
description: resource deleted
|
||||
description: resource
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Resource"
|
||||
|
||||
/w/{workspace}/resources/get_value/{path}:
|
||||
get:
|
||||
summary: get resource value
|
||||
operationId: getResourceValue
|
||||
tags:
|
||||
- resource
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/WorkspaceId"
|
||||
- $ref: "#/components/parameters/Path"
|
||||
responses:
|
||||
"200":
|
||||
description: resource value
|
||||
content:
|
||||
application/json:
|
||||
schema: {}
|
||||
|
||||
/w/{workspace}/resources/exists/{path}:
|
||||
get:
|
||||
summary: does resource exists
|
||||
|
||||
@@ -734,7 +734,7 @@ async fn transform_json_value(
|
||||
Value::String(y) if y.starts_with("$var:") => {
|
||||
let path = y.strip_prefix("$var:").unwrap();
|
||||
let v = client
|
||||
.get_variable(workspace, path, None)
|
||||
.get_variable(workspace, path, Some(true))
|
||||
.await
|
||||
.map_err(to_anyhow)
|
||||
.map(|v| v.into_inner())?
|
||||
@@ -753,15 +753,11 @@ async fn transform_json_value(
|
||||
));
|
||||
}
|
||||
let v = client
|
||||
.get_resource(workspace, path)
|
||||
.get_resource_value(workspace, path)
|
||||
.await
|
||||
.map_err(to_anyhow)?;
|
||||
transform_json_value(
|
||||
client,
|
||||
workspace,
|
||||
serde_json::to_value(v.into_inner()).map_err(to_anyhow)?,
|
||||
)
|
||||
.await
|
||||
.map_err(to_anyhow)?
|
||||
.into_inner();
|
||||
transform_json_value(client, workspace, v).await
|
||||
}
|
||||
Value::Object(mut m) => {
|
||||
for (a, b) in m.clone().into_iter() {
|
||||
|
||||
Reference in New Issue
Block a user