[Spring] Adds feature useOptional (#5968)

* Adds Valid annotation for request body (#4847)

If useBeanValidation is active, this change will add Valid annotation to ReqeustBody

* Adds generated samples for bean vaildation in spring boot (#4847)

* Adds feature option (#3819)

When you enable the feature useOptional the JavaSpring generator will use type Optional for non required parameters.

* Adds generated sample for #3819

* Adds generated sample for #3819

* Reverts commit for bean validation

* Adds generated sample for #3819

* Reverts commit for bean validation

* Fix alignment

* update spring samples

* update pom.xml to include spring use optional samples

* update artifactId to "spring-boot-beanvalidation"

* rpelace tab with 4-space

* check mvn task result
This commit is contained in:
wing328
2017-07-03 17:40:00 +08:00
committed by GitHub
parent e50a4cca36
commit ecf924e78f
76 changed files with 5465 additions and 18 deletions

View File

@@ -23,6 +23,9 @@ import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
{{#useOptional}}
import java.util.Optional;
{{/useOptional}}
{{#async}}
import java.util.concurrent.{{^jdk8}}Callable{{/jdk8}}{{#jdk8}}CompletableFuture{{/jdk8}};
{{/async}}