Skip to content

aaitmouloud/springfox-collection-example-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Collection Example plugin for Springfox

Build Status

What does it do

It allows you to have a correct example generated for all java.util.Collection typed properties.

For example, this:

@ApiModelProperty(value ="my property description", example = "2019-12-20T12:00:00")
@NotNull
private List<LocalDateTime> dates;

Would generate this:

{
    "properties": {
        "autresDates": {
            "type": "array",
            "example": [
                "2019-12-20T12:00:00"
            ],
            "description": "my property description",
            "items": {
                "type": "string",
                "format": "date-time"
            }
        }
    }
}

Usage

Maven

Add this to your pom.xml in the <dependencies>

<dependency>
    <groupId>com.github.aaitmouloud</groupId>
    <artifactId>springfox-collection-example-plugin</artifactId>
    <version>3.0.0</version>
</dependency>

Gradle

Add this to your dependencies in your build.gradle

implementation 'com.github.aaitmouloud:springfox-collection-example-plugin:3.0.0'

Spring

Just add the springfox.collection.example.plugins package to your Spring context

For example, while using Spring Boot:

@ComponentScan({"springfox.collection.example.plugins"})
public class MyConfigurationClass {
}

Contributors

  • @aaitmouloud
  • @geld0r : PR #5

See also

About

Springfox plugin to have correct collection examples

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages