Skip to content

Validate spec references with swagger parser#60

Merged
ChiragAgg5k merged 1 commit intomainfrom
codex/fix-1-8-console-missing-column-defs
May 4, 2026
Merged

Validate spec references with swagger parser#60
ChiragAgg5k merged 1 commit intomainfrom
codex/fix-1-8-console-missing-column-defs

Conversation

@ChiragAgg5k
Copy link
Copy Markdown
Member

@ChiragAgg5k ChiragAgg5k commented May 4, 2026

What changed

  • Removed 1.9-only string type references from the 1.8.x console and server specs:
    • attributeVarchar, attributeText, attributeMediumtext, attributeLongtext
    • columnVarchar, columnText, columnMediumtext, columnLongtext
  • Added @apidevtools/swagger-parser and a validate:refs script that dereferences every spec file with schema/spec validation disabled, catching unresolved $ref pointers without failing on unrelated historical schema-shape issues.
  • Wired the parser-based ref validation into CI before the external Swagger Validator step.
  • Added the missing metric schema to 0.12.x-0.14.x console Swagger/OpenAPI specs so the strict ref validator passes across the existing repository baseline.

Why

Fixes #46. The 1.8.x specs referenced local schemas that do not exist. These string types were introduced in Appwrite 1.9.0, so 1.8.x should not advertise them in collection/table response unions.

The new parser validation catches the original broken 1.8.x spec with: Missing $ref pointer "#/definitions/columnVarchar".

Reference: https://github.com/appwrite/appwrite/releases/tag/1.9.0

Testing

  • npm ci --no-audit --no-fund
  • npm run validate:refs -- specs
  • Confirmed the validator fails on the original 1.8.x console Swagger spec from origin/main with the missing columnVarchar ref.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 4, 2026

Greptile Summary

This PR fixes dangling $ref pointers in the 1.8.x console and server specs (attribute/column string types introduced in 1.9.0), adds the missing metric schema to the 0.12.x–0.14.x baseline specs, and introduces a validate-local-refs.js script backed by @apidevtools/swagger-parser to catch these breakages in CI before the external Swagger Validator step. The approach is sound and the previous review concerns about the PR description scope have been addressed.

Confidence Score: 5/5

Safe to merge — only a P2 suggestion about pinning Node.js in CI; all spec fixes and the new validation script are correct.

All findings are P2 (no P0 or P1). The spec removals are accurate, the script logic is correct, and the CI wiring works as described.

.github/workflows/ci.yml — missing setup-node step

Important Files Changed

Filename Overview
.github/workflows/ci.yml Added npm install + validate:refs step before external Swagger validation; bumped checkout v4→v6; missing explicit setup-node step
scripts/validate-local-refs.js New script that dereferences every spec file via swagger-parser with schema/spec validation disabled; correctly surfaces broken $ref pointers only
package.json Added validate:refs script and @apidevtools/swagger-parser devDependency
specs/1.8.x/open-api3-1.8.x-console.json Removed dangling $refs to attributeVarchar/Text/Mediumtext/Longtext and columnVarchar/Text/Mediumtext/Longtext (1.9.x-only schemas) from union types
specs/1.8.x/swagger2-1.8.x-console.json Same $ref removals as the OpenAPI 3 console spec — mirrors the fix for the Swagger 2 variant
specs/1.8.x/open-api3-1.8.x-server.json Removed the same 1.9-only attribute/column $refs from the server spec
specs/1.8.x/swagger2-1.8.x-server.json Removed the same 1.9-only attribute/column $refs from the Swagger 2 server spec
specs/0.12.x/open-api3-0.12.x-console.json Added missing metric schema so the new ref validator passes on this baseline spec
specs/0.13.x/open-api3-0.13.x-console.json Added missing metric schema — same fix as 0.12.x
specs/0.14.x/open-api3-0.14.x-console.json Added missing metric schema — same fix as 0.12.x and 0.13.x

Reviews (4): Last reviewed commit: "Validate spec references with swagger pa..." | Re-trigger Greptile

@ChiragAgg5k ChiragAgg5k force-pushed the codex/fix-1-8-console-missing-column-defs branch from 8c6754c to e29ac73 Compare May 4, 2026 13:07
@ChiragAgg5k ChiragAgg5k changed the title Fix missing 1.8 console schema definitions Remove 1.9 string type refs from 1.8 specs May 4, 2026
@ChiragAgg5k ChiragAgg5k force-pushed the codex/fix-1-8-console-missing-column-defs branch from e29ac73 to d32828c Compare May 4, 2026 13:12
@ChiragAgg5k ChiragAgg5k changed the title Remove 1.9 string type refs from 1.8 specs Validate local spec references May 4, 2026
@ChiragAgg5k ChiragAgg5k force-pushed the codex/fix-1-8-console-missing-column-defs branch from d32828c to 07d3e9b Compare May 4, 2026 13:21
@ChiragAgg5k ChiragAgg5k changed the title Validate local spec references Validate spec references with swagger parser May 4, 2026
@ChiragAgg5k ChiragAgg5k force-pushed the codex/fix-1-8-console-missing-column-defs branch from 07d3e9b to b7e2798 Compare May 4, 2026 13:22
@ChiragAgg5k ChiragAgg5k merged commit 70eae06 into main May 4, 2026
2 checks passed
@ChiragAgg5k ChiragAgg5k deleted the codex/fix-1-8-console-missing-column-defs branch May 4, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1.8.x Console Spec broken

1 participant