mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-20 16:07:09 +00:00
[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:
@@ -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}}
|
||||
|
||||
Reference in New Issue
Block a user