Implement Bookings API from OpenAPI Spec
Hand Devin a YAML spec and get fully implemented Express route handlers, Prisma models, Zod validation, and Supertest integration tests — matching your existing codebase patterns.(Optional) Research your existing API patterns
If you’re not sure how your Express API is structured or which patterns to reference, use Ask Devin to investigate first:You can also use DeepWiki to explore open-source APIs with similar patterns — for example, search for Express + Prisma + Zod examples to see how other projects structure their route handlers and validation.You can start a Devin session directly from Ask Devin, and it will carry over everything it learned as context.
Point Devin at your OpenAPI spec
Start by telling Devin where the spec lives and which resource to implement. Devin reads every path, schema, and error definition in the YAML, then cross-references your existing Express routes to match conventions automatically.Here’s an excerpt from the kind of spec Devin works with — a standard OpenAPI 3.0 definition for a bookings resource:If your spec isn’t checked into the repo yet, paste it directly into the session or attach the YAML/JSON file when starting.
Devin matches your Express patterns
The single most impactful thing you can do is reference a well-implemented resource in your codebase. Devin studies that code and replicates the folder structure, naming conventions, middleware chain, and error handling — so the new endpoints look like they were written by the same developer.For example, Devin reads Devin also derives Zod schemas directly from the OpenAPI component definitions, so request validation stays in sync with the spec:Make sure your repo setup includes the test database configuration and any required environment variables so Devin can run the full test suite locally. If your API needs credentials (database URL, JWT secret, etc.), add them as Secrets before starting the session — or provide them during the session via chat.
src/api/v2/users/router.ts and produces a matching bookings router:Devin delivers a tested PR
Devin reads the spec, studies your existing code, and implements each endpoint to match both the OpenAPI contract and your Express codebase conventions. Here’s what a typical PR looks like:Devin runs the Supertest suite before opening the PR:
Iterate on what the spec doesn't cover
The OpenAPI spec defines the contract but rarely captures business rules, authorization logic, or performance requirements. Use follow-up prompts to fill in the gaps:
Review the PR with Devin Review
Once Devin opens the PR, use Devin Review to review the implementation. Devin Review can catch issues like missing error handling, inconsistent response formats, or endpoints that don’t match the spec.If Devin Review flags issues, you can use Autofix to have Devin automatically fix the flagged problems — it opens a follow-up session, applies the fixes, and pushes an updated commit without you having to describe each change manually.
