Swagger UI renders interactive API documentation in the browser from an OpenAPI/Swagger specification file.
swagger-api/swagger-core
Java library that generates OpenAPI specifications from code annotations and JAX-RS REST APIs, supporting OpenAPI 3.x.
- Stars
- 7,535
- Forks
- 2,255
- Open issues
- 219
- Last commit
- 2 days ago
What is it?
Swagger Core is the Java implementation of the OpenAPI Specification. It reads annotations and REST resource classes in a Java application and produces an OpenAPI document describing the endpoints, parameters, request bodies and response models, which tools such as Swagger UI can then render as interactive API documentation.
The project targets JAX-RS 2 applications and ships parallel artifact sets for both the javax and Jakarta namespaces. Since version 2.2.0 it supports OpenAPI 3.1, and the older 1.x line covers OpenAPI 2.0. A BOM artifact is provided to manage the versions of the individual modules in Maven and Gradle builds.
The repository is a Maven multi-module build requiring Java 11 or later. Integration samples have been moved to a separate swagger-samples repository.
Key features
- 01Generates OpenAPI 3.x documents from Java annotations and JAX-RS resources.
- 02Supports both javax and Jakarta namespace artifacts.
- 03Provides OpenAPI 3.1 support since version 2.2.0.
- 04Offers a BOM for consistent dependency versions in Maven and Gradle.
Use cases
- Documenting a Java REST API by generating its OpenAPI spec from code.
- Adding interactive API docs to a JAX-RS service.
- Migrating a Java service from the javax to the Jakarta namespace while keeping API docs.
Things to know
- Targets Java and JAX-RS2 APIs, so it does not suit other stacks.
Topics
FAQ
- What is swagger-core?
- Java library that generates OpenAPI specifications from code annotations and JAX-RS REST APIs, supporting OpenAPI 3.x. Swagger Core is the Java implementation of the OpenAPI Specification. It reads annotations and REST resource classes in a Java application and produces an OpenAPI document describing the endpoints, parameters, request bodies and response models, which tools such as Swagger UI can then render as interactive API documentation.
- Is swagger-core free to use? What license does it have?
- swagger-core is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is swagger-core still maintained?
- Actively maintained. The last commit to swagger-core was on Nov 5, 2026.
- What can I use swagger-core for?
- Documenting a Java REST API by generating its OpenAPI spec from code. Adding interactive API docs to a JAX-RS service. Migrating a Java service from the javax to the Jakarta namespace while keeping API docs.
- Where can I get swagger-core?
- The source code and installation instructions are on GitHub: https://github.com/swagger-api/swagger-core
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Command-line tool that generates API client SDKs, server stubs and HTML docs from an OpenAPI/Swagger definition.
Open-source OpenAPI/Swagger toolkit with an interactive API reference, an offline-first API client, and integrations for many web frameworks.
Open-source tool that generates a responsive, three-panel API reference site from OpenAPI, Swagger, AsyncAPI, or GraphQL definitions.
A Go command-line tool and library that generates server boilerplate, API clients and models from OpenAPI 3.0 and 3.1 specifications.
Generates TypeScript types from OpenAPI 3 schemas, plus a type-safe fetch client built on those types.