OpenAPIController Generator

Paste an OpenAPI 3 spec — JSON or YAML — and get Spring Boot controllers, one per tag, with mappings, parameters and return types.

In-browser & private
Advertisement
OpenAPI spec (JSON or YAML) Ctrl + Enter to generate
Java
Paste a spec on the left, or press Sample.
Controllers Endpoints Size 0 B

What it generates, and why

  • One controller per tag. A spec's tags are already the author's grouping of the API, so following them produces the file layout a person would have chosen by hand.
  • Optional query parameters say so. A parameter that is not required is emitted as @RequestParam(required = false) — without it Spring returns 400 whenever the caller leaves it out, which is the opposite of what the spec says.
  • Path variables are bound by name. {orderId} becomes @PathVariable("orderId") when the Java name differs, so it keeps working after compilation without -parameters.
  • Interface mode puts the mappings in the interface. That keeps the annotations in step with the spec while your implementation stays yours — regenerate the interface, and the compiler tells you what changed.
  • Bodies are typed. The request body schema resolves to the same DTO name the DTO generator produces, so the two outputs fit together.

More free tools