Menu

1 / 13

Can you catch Express and OpenAPI drift without starting the server?

DEV Community: typescript·Nikhil Verma·9 days ago
#V73hsj0r
#devtotypescript#devto#dev#openapi#express
Long article (332 words) — no AI summary yet.
Reading 0:00
15s threshold

CI check should be able to tell you when DELETE /users/:id exists in your Express app but is missing from openapi.yaml. That’s the problem I built SpecSync to solve.

SpecSync statically reads Express route registrations in JavaScript and TypeScript and compares them with the paths and HTTP methods in your OpenAPI spec. In the repo’s sample, it catches an undocumented DELETE /users/{id} and points to the source line.

Sample feature: https://github.com/specsyncs/specsync-cli/tree/v0.1.1/tests/fixtures/scenarios/undocumented-route

To try v0.1.1 on your own project:

npx --yes @specsyncs/[email protected] check --openapi openapi.yaml --fail-on never

Enter fullscreen mode

Exit fullscreen mode

--fail-on never lets you inspect drift findings without failing the build on those findings. I’m looking for feedback from people with real Express routing setups, especially nested routers, dynamic paths, and APIs with a base path. What did it get wrong on your project?…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.