fix(core): use current workspace with /new; fix warping into local project (#25894)

This commit is contained in:
James Long
2026-05-05 16:39:37 -04:00
committed by GitHub
parent 8e182c7782
commit 12f3d1f505
5 changed files with 28 additions and 7 deletions

View File

@@ -146,6 +146,16 @@ function matchLegacyOpenApi(input: Record<string, unknown>) {
if (properties?.branch) properties.branch = { anyOf: [properties.branch, { type: "null" }] }
if (properties?.extra) properties.extra = { anyOf: [properties.extra, { type: "null" }] }
}
if (path === "/experimental/workspace/warp" && method === "post") {
const ref = operation.requestBody.content?.["application/json"]?.schema?.$ref?.replace(
"#/components/schemas/",
"",
)
const properties = ref
? spec.components?.schemas?.[ref]?.properties
: operation.requestBody.content?.["application/json"]?.schema?.properties
if (properties?.id) properties.id = { anyOf: [properties.id, { type: "null" }] }
}
}
for (const response of Object.values(operation.responses ?? {})) {
for (const content of Object.values(response.content ?? {})) {