API Design Linter and Playground for OpenAPI Specifications
Teams write API style guides and then ship endpoints that return 200 with an error inside, paginate three different ways and version nothing. Build a linter and web playground that checks an OpenAPI description against a style guide covering status codes, pagination, versioning, naming and error shape, and explains every finding with the reason behind the rule and a corrected example. Useful to working teams, and a structured way to learn API design properly.
Intermediate
A small team, or one strong student willing to learn something new.1 semester · 2 students
7 to ship
4 optional extrasSuggested stack
What you should ship
- An OpenAPI 3.0 and 3.1 parser that keeps line and column positions through $ref resolution
- A rule engine and a default style guide of at least 25 tested rules covering status codes, errors, pagination, versioning, naming and security
- An explanation, a documentation page and a before and after example for every rule
- A web playground showing findings inline next to the specification
- A command line tool with a configuration file and a CI mode that fails the build on errors
- An evaluation over at least 30 public OpenAPI descriptions with false positives checked by hand
- A comparison with Spectral's built-in OpenAPI ruleset and a small user study on the value of the explanations
If you have time left
- Automatic fixes for simple findings, shown as a diff before they are applied
- A style guide document generated from the enabled rules and their explanations
- Support for AsyncAPI descriptions
- An editor extension that shows findings while the specification is being written
Problem
API design mistakes are cheap to fix before an endpoint ships and expensive afterwards, because clients start depending on them. Style guides exist, but nobody reads a thirty-page document during a pull request. Existing linters such as Spectral report a rule name and a line number. They rarely explain why the rule exists, which is what a junior developer needs in order to stop making the mistake.
This is different from the API Contract Checker idea in this library, which compares two versions of an API to find breaking changes. This project checks the design of a single API against a written standard.
What you build
- A parser for OpenAPI 3.0 and 3.1 in YAML or JSON that keeps line and column positions, so findings point to the exact place in the file.
- A rule engine where each rule is a small, tested function with an id, a severity, a message, an explanation, a documentation link and a before and after example.
- A default style guide of at least 25 rules, for example:
- Status codes: creation returns 201 with a Location header, deletion returns 204 with no body, every operation documents its 4xx responses, and no error is returned with 200.
- Errors: one error shape across the API, ideally Problem Details as defined in RFC 9457.
- Pagination: every list endpoint is paginated, with the same parameter names and response fields everywhere.
- Versioning: one strategy used consistently, in the path or in a header.
- Naming: plural resource nouns and consistent casing for paths, parameters and fields.
- Safety: security schemes defined and applied, and endpoints that create payments or orders accept an idempotency key.
- A web playground: paste or upload a specification, see findings inline next to the source, and open a finding to read its explanation.
- A command line tool with configurable rules and a CI mode that fails on errors.
Suggested architecture
- TypeScript for the engine, so the same code runs in the command line tool and in the browser. Use a YAML parser that preserves positions and a JSON Schema validator for structure, and write the rule engine yourself.
- A code editor component such as CodeMirror or Monaco for the playground.
- Rules as plain modules, each with unit tests built from small specification fragments that should pass and fail.
Milestones by month
- Month 1: parser with positions, rule engine, first ten rules with tests, command line output.
- Month 2: remaining rules, explanations and documentation pages, configuration file.
- Month 3: web playground, CI mode, a GitHub Action.
- Month 4: evaluation on public specifications and with developers, report and demo.
How it will be assessed
- Results from running the linter over at least 30 public OpenAPI descriptions: the most common findings, false positives found by hand review, and runtime per specification.
- A comparison with Spectral's built-in OpenAPI ruleset on the same specifications: overlap, rules only you have, and rules only Spectral has.
- A study with at least eight student developers, each fixing one flawed specification with rule names only and another with your explanations, measuring time and correctness.
- Test coverage of the rule engine.
Pitfalls
- Presenting opinions as facts. Where reasonable teams disagree, such as path versioning against header versioning, make the rule configurable and say so in the explanation.
- Treating OpenAPI 3.0 and 3.1 as identical. Their schema handling differs.
- Losing line numbers after resolving $ref references, which makes findings impossible to locate.
- Explanations that turn into essays. Two or three sentences and an example are enough.
Ideas and guidance, not finished projects
These are project ideas and scoping guidance, published free for students to use as a starting point. I do not build, write, or sell final-year projects, and I do not complete coursework for anyone. Take an idea, make it yours, and build it.
Not sure this one fits you?
I help students pick an idea that matches their skills and their deadline, then scope it down until it is finishable. Guidance only, never done for you.
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
Follow along
New writing, resources and project ideas land here first.