From 13590ffab3b191e4668a10e41cf7489ac8d50150 Mon Sep 17 00:00:00 2001 From: Patrick Amrein Date: Fri, 10 Apr 2020 14:30:46 +0200 Subject: [PATCH] add example if we have documentation --- pom.xml | 2 +- src/main/java/ch/ubique/openapi/SwaggerGenerator.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2171c27..ce7874d 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ ch.ubique.openapi springboot-swagger-3 - 1.1.1 + 1.1.2 maven-plugin diff --git a/src/main/java/ch/ubique/openapi/SwaggerGenerator.java b/src/main/java/ch/ubique/openapi/SwaggerGenerator.java index f78b04c..2d034d1 100644 --- a/src/main/java/ch/ubique/openapi/SwaggerGenerator.java +++ b/src/main/java/ch/ubique/openapi/SwaggerGenerator.java @@ -424,6 +424,7 @@ private Map getRequestParam(java.lang.reflect.Parameter obj) { if(obj.getAnnotation(documentation) != null) { DocumentationWrapper docWrapper = new DocumentationWrapper(obj.getAnnotation(documentation)); param.put("description", docWrapper.description()); + param.put("example", docWrapper.example()); } else { param.put("description", wrap.name()); @@ -468,6 +469,7 @@ private Map getPathParam(java.lang.reflect.Parameter obj) { if(obj.getAnnotation(documentation) != null) { DocumentationWrapper docWrapper = new DocumentationWrapper(obj.getAnnotation(documentation)); param.put("description", docWrapper.description()); + param.put("example", docWrapper.example()); } else { param.put("description", wrap.name()); @@ -511,6 +513,7 @@ private Map getRequestHeader(java.lang.reflect.Parameter obj) { if(obj.getAnnotation(documentation) != null) { DocumentationWrapper docWrapper = new DocumentationWrapper(obj.getAnnotation(documentation)); param.put("description", docWrapper.description()); + param.put("example", docWrapper.example()); } else { param.put("description", wrap.name());