All Projects → springdoc → Springdoc Openapi

springdoc / Springdoc Openapi

Licence: apache-2.0
Library for OpenAPI 3 with spring-boot

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Springdoc Openapi

Swagger Ui
Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
Stars: ✭ 21,279 (+1811.86%)
Mutual labels:  rest-api, swagger, openapi, openapi3, swagger-ui, openapi-specification
Apispec
A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification)..
Stars: ✭ 831 (-25.34%)
Mutual labels:  rest-api, swagger, openapi, openapi3, openapi-specification
Swagger Parser
Swagger Spec to Java POJOs
Stars: ✭ 468 (-57.95%)
Mutual labels:  rest-api, swagger, openapi, openapi3, openapi-specification
Drf Yasg
Automated generation of real Swagger/OpenAPI 2.0 schemas from Django REST Framework code.
Stars: ✭ 2,523 (+126.68%)
Mutual labels:  rest-api, swagger, openapi, swagger-ui, openapi-specification
Swagger Editor
Swagger Editor
Stars: ✭ 7,365 (+561.73%)
Mutual labels:  rest-api, swagger, openapi3, swagger-ui, openapi-specification
Flasgger
Easy OpenAPI specs and Swagger UI for your Flask API
Stars: ✭ 2,825 (+153.82%)
Mutual labels:  rest-api, swagger, openapi, swagger-ui, openapi-specification
Swagger Core
Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
Stars: ✭ 6,898 (+519.77%)
Mutual labels:  rest-api, swagger, openapi, openapi3, openapi-specification
Oapi Codegen
Generate Go client and server boilerplate from OpenAPI 3 specifications
Stars: ✭ 806 (-27.58%)
Mutual labels:  rest-api, swagger, openapi, openapi3
Django Ninja
💨 Fast, Async-ready, Openapi, type hints based framework for building APIs
Stars: ✭ 875 (-21.38%)
Mutual labels:  rest-api, swagger, openapi, swagger-ui
Mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
Stars: ✭ 3,448 (+209.79%)
Mutual labels:  rest-api, swagger, openapi, openapi3
Safrs
SqlAlchemy Flask-Restful Swagger Json:API OpenAPI
Stars: ✭ 255 (-77.09%)
Mutual labels:  rest-api, swagger, openapi, openapi3
openapi-schemas
JSON Schemas for every version of the OpenAPI Specification
Stars: ✭ 22 (-98.02%)
Mutual labels:  swagger, openapi, openapi-specification, openapi3
Openapi.tools
A collection of Editors, Linters, Parsers, Code Generators, Documentation, Testing
Stars: ✭ 257 (-76.91%)
Mutual labels:  swagger, openapi, openapi3, openapi-specification
Openapi Directory
🌐 Wikipedia for Web APIs. Directory of REST API definitions in OpenAPI 2.0/3.x format
Stars: ✭ 2,635 (+136.75%)
Mutual labels:  rest-api, swagger, openapi, openapi3
Swagger Js
Javascript library to connect to swagger-enabled APIs via browser or nodejs
Stars: ✭ 2,319 (+108.36%)
Mutual labels:  rest-api, swagger, openapi3, openapi-specification
Spectral
A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.
Stars: ✭ 876 (-21.29%)
Mutual labels:  swagger, openapi, openapi3, openapi-specification
Gemini
Model Driven REST framework to automatically generate CRUD APIs
Stars: ✭ 138 (-87.6%)
Mutual labels:  rest-api, swagger, openapi, spring-boot
Swagger Codegen
swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
Stars: ✭ 13,859 (+1145.19%)
Mutual labels:  rest-api, swagger, openapi3, openapi-specification
Drf Spectacular
Sane and flexible OpenAPI 3 schema generation for Django REST framework.
Stars: ✭ 414 (-62.8%)
Mutual labels:  rest-api, swagger, openapi3, openapi-specification
Oas Kit
Convert Swagger 2.0 definitions to OpenAPI 3.0 and resolve/validate/lint
Stars: ✭ 516 (-53.64%)
Mutual labels:  swagger, openapi, openapi3, openapi-specification

Build Status Quality Gate Known Vulnerabilities

Octocat

Full documentation

Acknowledgements

springdoc-openapi is made possible thanks to all of its contributors.

Introduction

The springdoc-openapi Java library helps automating the generation of API documentation using Spring Boot projects. springdoc-openapi works by examining an application at runtime to infer API semantics based on Spring configurations, class structure and various annotations.

The library automatically generates documentation in JSON/YAML and HTML formatted pages. The generated documentation can be complemented using swagger-api annotations.

This library supports:

  • OpenAPI 3
  • Spring-boot (v1 and v2)
  • JSR-303, specifically for @NotNull, @Min, @Max, and @Size.
  • Swagger-ui
  • Oauth 2

The following video introduces the Library:

This is a community-based project, not maintained by the Spring Framework Contributors (Pivotal)

Getting Started

Library for springdoc-openapi integration with spring-boot and swagger-ui

  • Automatically deploys swagger-ui to a Spring Boot 2.x application
  • Documentation will be available in HTML format, using the official swagger-ui jars.
  • The Swagger UI page should then be available at http://server:port/context-path/swagger-ui.html and the OpenAPI description will be available at the following url for json format: http://server:port/context-path/v3/api-docs
    • server: The server name or IP
    • port: The server port
    • context-path: The context path of the application
  • Documentation can be available in yaml format as well, on the following path: /v3/api-docs.yaml
  • Add the springdoc-openapi-ui library to the list of your project dependencies (No additional configuration is needed):
   <dependency>
      <groupId>org.springdoc</groupId>
      <artifactId>springdoc-openapi-ui</artifactId>
      <version>last-release-version</version>
   </dependency>
  • This step is optional: For custom path of the swagger documentation in HTML format, add a custom springdoc property, in your spring-boot configuration file:
# swagger-ui custom path
springdoc.swagger-ui.path=/swagger-ui.html

Source code of the Demo Applications

Spring-boot with OpenAPI Demo applications.

Demo Spring Boot 2 Web MVC with OpenAPI 3.

Demo Spring Boot 2 WebFlux with OpenAPI 3.

Demo Spring Boot 1 Web MVC with OpenAPI 3.

Demo Spring Boot 2 WebFlux with Functional endpoints OpenAPI 3.

Demo Spring Boot 2 and Spring Hateoas with OpenAPI 3.

Branching

Integration of the library in a Spring Boot 2.x.x project without the swagger-ui:

  • Documentation will be available at the following url for json format: http://server:port/context-path/v3/api-docs
    • server: The server name or IP
    • port: The server port
    • context-path: The context path of the application
  • Documentation will be available in yaml format as well, on the following path : /v3/api-docs.yaml
  • Add the library to the list of your project dependencies. (No additional configuration is needed)
   <dependency>
      <groupId>org.springdoc</groupId>
      <artifactId>springdoc-openapi-webmvc-core</artifactId>
      <version>last-release-version</version>
   </dependency>
  • This step is optional: For custom path of the OpenAPI documentation in Json format, add a custom springdoc property, in your spring-boot configuration file:
# /api-docs endpoint custom path
springdoc.api-docs.path=/api-docs
  • This step is optional: If you want to disable springdoc-openapi endpoints, add a custom springdoc property, in your spring-boot configuration file:
# disable api-docs
springdoc.api-docs.enabled=false

Error Handling for REST using @ControllerAdvice

To generate documentation automatically, make sure all the methods declare the HTTP Code responses using the annotation: @ResponseStatus

Adding API Information and Security documentation

The library uses spring-boot application auto-configured packages to scan for the following annotations in spring beans: OpenAPIDefinition and Info. These annotations declare, API Information: Title, version, licence, security, servers, tags, security and externalDocs. For better performance of documentation generation, declare @OpenAPIDefinition and @SecurityScheme annotations within a Spring managed bean.

spring-webflux support with Annotated Controllers

  • Documentation can be available in yaml format as well, on the following path : /v3/api-docs.yaml
  • Add the library to the list of your project dependencies ( No additional configuration is needed)
   <dependency>
      <groupId>org.springdoc</groupId>
      <artifactId>springdoc-openapi-webflux-ui</artifactId>
      <version>last-release-version</version>
   </dependency>
  • This step is optional: For custom path of the swagger documentation in HTML format, add a custom springdoc property, in your spring-boot configuration file:
# swagger-ui custom path
springdoc.swagger-ui.path=/swagger-ui.html

The springdoc-openapi libraries are hosted on maven central repository. The artifacts can be viewed accessed at the following locations:

Releases:

Snapshots:

Thank you for the support

  • Thanks a lot JetBrains for supporting springdoc-openapi project.

JenBrains logo

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].