Point the .roomodes schema identity at the actual JSON document

The generated schema currently advertises a GitHub blob page as its $id,
which returns HTML rather than the schema document itself.

This updates the source-of-truth generator and checked-in schema to use
a JSON-serving raw URL, and adds a regression assertion for the canonical
metadata value.

Constraint: Must keep the checked-in schema aligned with the generator output
Rejected: Leave the blob URL in place | Schema consumers dereferencing $id receive HTML
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: If the schema is moved in the future, keep $id pointing at a JSON-serving canonical URL
Tested: pnpm --dir packages/types exec vitest run src/__tests__/roomodes-schema.spec.ts src/__tests__/roomodes-schema-sync.spec.ts
Not-tested: External IDE/schema consumer end-to-end dereference behavior
This commit is contained in:
JunghwanNA 2026-04-17 00:43:15 +09:00
parent cb83656718
commit 17d812c6a6
3 changed files with 6 additions and 2 deletions

View file

@ -28,6 +28,10 @@ describe("roomodes JSON schema", () => {
expect(validate).toBeDefined()
})
it("should advertise a JSON-serving canonical $id", () => {
expect(schema["$id"]).toBe("https://raw.githubusercontent.com/RooCodeInc/Roo-Code/main/schemas/roomodes.json")
})
it("should accept a minimal valid .roomodes config", () => {
const config = {
customModes: [

View file

@ -50,7 +50,7 @@ export function generateRoomodesJsonSchema(): Record<string, unknown> {
target: "jsonSchema7",
}) as Record<string, unknown>
jsonSchema["$id"] = "https://github.com/RooCodeInc/Roo-Code/blob/main/schemas/roomodes.json"
jsonSchema["$id"] = "https://raw.githubusercontent.com/RooCodeInc/Roo-Code/main/schemas/roomodes.json"
jsonSchema["title"] = "Roo Code Custom Modes"
jsonSchema["description"] = "Schema for .roomodes configuration files used by Roo Code to define custom modes."

View file

@ -90,7 +90,7 @@
"required": ["customModes"],
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://github.com/RooCodeInc/Roo-Code/blob/main/schemas/roomodes.json",
"$id": "https://raw.githubusercontent.com/RooCodeInc/Roo-Code/main/schemas/roomodes.json",
"title": "Roo Code Custom Modes",
"description": "Schema for .roomodes configuration files used by Roo Code to define custom modes."
}