feat(core): expose project reference filesystem access (#30423)

This commit is contained in:
Shoubhit Dash
2026-06-02 20:59:07 +05:30
committed by GitHub
parent 8a17bc4de0
commit 380931a827
5 changed files with 204 additions and 24 deletions

View File

@@ -9,7 +9,12 @@ type OpenApiResponse = {
readonly content?: Record<string, { readonly schema?: OpenApiSchema }>
}
type OpenApiOperation = {
readonly parameters?: ReadonlyArray<{ readonly name: string; readonly in: string }>
readonly parameters?: ReadonlyArray<{
readonly name: string
readonly in: string
readonly required?: boolean
readonly schema?: { readonly type?: string }
}>
readonly responses?: Record<string, OpenApiResponse>
readonly security?: unknown
}
@@ -53,6 +58,19 @@ describe("PublicApi OpenAPI v2 errors", () => {
}
})
test("documents optional project reference aliases for filesystem reads and lists", () => {
const spec = OpenApi.fromApi(PublicApi) as OpenApiSpec
for (const path of ["/api/fs/read", "/api/fs/list"]) {
expect(spec.paths[path]?.get?.parameters, path).toContainEqual({
in: "query",
name: "reference",
required: false,
schema: { type: "string" },
})
}
})
test("does not rewrite /api endpoint errors to legacy error components", () => {
const spec = OpenApi.fromApi(PublicApi) as OpenApiSpec
const refs = v2Operations(spec)