Skip to content

Swaggy-Swagger/swagger-custom-java

Repository files navigation

Swaggy Swagger



Swaggy-Swagger-Logo

Swaggy Swagger

Jitpack Release License Fossa License Scan FOSSA Status github release github last release date
github contributors github stars github discussions


English | 한국어

Overview

Swaggy-Swagger is a library designed to enhance the functionality and user experience of the popular API documentation tool, Swagger. See Swaggy-Swagger README.md for more details.

Demo Website

swaggy-swagger.vercel.app

Demo Video

Requirements

  • Java 17 or higher: This project requires Java version 17 or later.
  • Spring Boot 3.x: Ensure that you are using Spring Boot version 3.x for compatibility.
  • Swagger dependency 2.x: Make sure to include springdoc-openapi version 2.x in your project dependencies for proper functionality.

Installation

Add dependency to your project

repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.Swaggy-Swagger:swagger-custom-java:1.0.1'
}

Version Information

Swaggy-Swagger Version Release Date Notes
1.0.1 2024-11-13 tag 1.0.1

Please use version 1.0.1 or above. Versions 1.0.0 and 0.0.1 contain known issues.

How to Apply Features

Order controller methods by code line number

import io.swaggy.swagger.customlib.config.SwaggyConfig;
import io.swaggy.swagger.customlib.utils.OpenApiChangeTracker;
import org.springdoc.core.customizers.OpenApiCustomizer;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

// Import 'SwaggyConfig' class to your OpenApi configuration class.
@Configuration
@Import(SwaggyConfig.class)
public class YourOpenApiConfig {
}

Order controllers by API Tags

The SwaggyConfig.class mentioned above must be imported into your project.

# application.yml 
swaggy:
  tags:
    - "tagName1"
    - "tagName2"
    - "tagName3"
    ...
example
application.yml Result
ymlEx sortByTagsResult

Track and save changes in api endpoints, parameters, dtos, etc

import io.swaggy.swagger.customlib.utils.OpenApiChangeTracker;
import org.springdoc.core.customizers.OpenApiCustomizer;
import org.springframework.context.annotation.Configuration;

@Configuration
public class YourOpenApiConfig {
    
    // Register 'OpenApiCustomizer' Bean to your OpenApi configuration class.
    @Bean
    public OpenApiCustomizer openApiCustomizer() {
        return new OpenApiChangeTracker();
    }
}

Ways to contribute

We always welcome your contributions!

  • If you would like to contribute to the frontend (UI), you can see swaggy-ui for more details.

  • Else, if you want to contribute to the backend (server-side), which is this repository, please refer to CONTRIBUTING.md.

Contributors

Thank you to everyone who contributed to our project.

Made with contrib.rocks

License

Swaggy-Swagger is licensed under the Apache License, Version 2.0.
See the LICENSE file for more details.

FOSSA Status

Contact