What do you think about generating OpenAPI specs from code?

This page summarizes the projects mentioned and recommended in the original post on /r/java

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • springfox

    Automated JSON API documentation for API's built with Spring

  • The only issue I saw on this is that controllers get a lot more cluttered. See an example.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • springdoc-openapi

    Library for OpenAPI 3 with spring-boot

  • I found SpringDoc, a library that automates the generation of the spec from the source code. It relies on annotations for textual bits (like tags and descriptions), but it also infers stuff from Spring annotations.

  • raido

    Raido - Oceania region implementation of the RAiD ISO standard

  • swagger-editor

    Swagger Editor

  • FWIW, we go the other way, i.e., using the spec to generate code using openapi-generator. Generated code quality is high. We generate both model classes and service interfaces. In practice, this allows the team to discuss API design decisions at a high level on the fly in the spec editor, and then use the generated code to quickly divide and conquer implementation. We are also more microservice than monolith, though, so we tend to have more, smaller APIs, which probably factors into our experience.

  • openapi-generator

    OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)

  • FWIW, we go the other way, i.e., using the spec to generate code using openapi-generator. Generated code quality is high. We generate both model classes and service interfaces. In practice, this allows the team to discuss API design decisions at a high level on the fly in the spec editor, and then use the generated code to quickly divide and conquer implementation. We are also more microservice than monolith, though, so we tend to have more, smaller APIs, which probably factors into our experience.

  • openapi-typescript

    Generate TypeScript types from OpenAPI 3 specs

  • I'm at a fairly small company (15devs max) and we do code first -> generate openapi spec with springdoc-openapi -> generate typescript httpclient with openapi-typescript for our frontend

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • The Stainless SDK Generator

    10 projects | news.ycombinator.com | 24 Apr 2024
  • How to Automatically Consume RESTful APIs in Your Frontend

    13 projects | dev.to | 25 Jan 2024
  • OpenAPI Client and Server Code Generator for Golang

    1 project | news.ycombinator.com | 30 Aug 2023
  • Combining oapi-codegen, echo and validator frameworks to build robust APIs

    2 projects | /r/golang | 24 Apr 2023
  • should i use a framework for apis?

    1 project | /r/golang | 15 Apr 2023