Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Java Libraries] Jakarta Validation API support useJakartaEe flag #19469

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ package {{invokerPackage}};

import java.util.Set;

import jakarta.validation.ConstraintViolation;
import jakarta.validation.ValidationException;
import {{javaxPackage}}.validation.ConstraintViolation;
import {{javaxPackage}}.validation.ValidationException;

public class BeanValidationException extends ValidationException {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import java.util.Map;
import java.util.StringJoiner;

{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;

{{/useBeanValidation}}
{{>generatedAnnotation}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import java.util.List;
import java.util.Map;

{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;

{{/useBeanValidation}}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,12 @@
{{/openApiNullable}}
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
<beanvalidation-version>3.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{^useJakartaEe}}
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<beanvalidation-version>2.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{#useBeanValidation}}
<beanvalidation-version>3.0.2</beanvalidation-version>
{{/useBeanValidation}}
<junit-version>5.10.2</junit-version>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;

{{/useBeanValidation}}
import feign.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import java.util.List;
import java.util.Map;

{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;

{{/useBeanValidation}}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ import android.os.Parcelable;
import android.os.Parcel;
{{/parcelableModel}}
{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import org.hibernate.validator.constraints.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,12 @@
{{/openApiNullable}}
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
<beanvalidation-version>3.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{^useJakartaEe}}
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<beanvalidation-version>2.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{#useBeanValidation}}
<beanvalidation-version>3.0.2</beanvalidation-version>
{{/useBeanValidation}}
<junit-version>5.10.0</junit-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<scribejava-version>8.3.3</scribejava-version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {{javaxPackage}}.ws.rs.core.GenericType;
{{/imports}}

{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;

{{/useBeanValidation}}
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import java.util.List;
import java.util.Map;

{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;

{{/useBeanValidation}}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ import android.os.Parcelable;
import android.os.Parcel;
{{/parcelableModel}}
{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import org.hibernate.validator.constraints.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,12 @@
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
<beanvalidation-version>3.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{^useJakartaEe}}
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<beanvalidation-version>2.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{#useBeanValidation}}
<beanvalidation-version>3.0.2</beanvalidation-version>
{{/useBeanValidation}}
<junit-version>5.10.0</junit-version>
{{#hasHttpSignatureMethods}}
<http-signature-version>1.8</http-signature-version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,7 @@
<jackson-databind-version>2.17.1</jackson-databind-version>
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
{{#useBeanValidation}}
<beanvalidation-version>3.0.2</beanvalidation-version>
{{/useBeanValidation}}
<junit-version>5.10.0</junit-version>
{{#hasHttpSignatureMethods}}
<http-signature-version>1.8</http-signature-version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;

{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;

{{/useBeanValidation}}
{{#hasFormParamsInSpec}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import java.util.concurrent.CompletableFuture;
{{/asyncNative}}

{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;

{{/useBeanValidation}}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ import android.os.Parcelable;
import android.os.Parcel;
{{/parcelableModel}}
{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import org.hibernate.validator.constraints.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,12 @@
<jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version>
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
<beanvalidation-version>3.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{^useJakartaEe}}
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<beanvalidation-version>2.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{#useBeanValidation}}
<beanvalidation-version>3.0.2</beanvalidation-version>
{{/useBeanValidation}}
{{#hasFormParamsInSpec}}
<httpmime-version>4.5.14</httpmime-version>
{{/hasFormParamsInSpec}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import io.swagger.v3.oas.models.parameters.Parameter;
import java.io.IOException;

{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import jakarta.validation.ConstraintViolation;
import jakarta.validation.Validation;
import jakarta.validation.ValidatorFactory;
import jakarta.validation.executable.ExecutableValidator;
import {{javaxPackage}}.validation.ConstraintViolation;
import {{javaxPackage}}.validation.Validation;
import {{javaxPackage}}.validation.ValidatorFactory;
import {{javaxPackage}}.validation.executable.ExecutableValidator;
import java.util.Set;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import java.io.InputStream;
{{/supportStreaming}}

{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;

{{/useBeanValidation}}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import android.os.Parcelable;
import android.os.Parcel;
{{/parcelableModel}}
{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}
{{#performBeanValidation}}
import org.hibernate.validator.constraints.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,16 +423,15 @@
{{/joda}}
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
<beanvalidation-version>3.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{^useJakartaEe}}
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<beanvalidation-version>2.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{#performBeanValidation}}
<jakarta.el-version>3.0.3</jakarta.el-version>
{{/performBeanValidation}}
{{#useBeanValidation}}
<beanvalidation-version>3.0.2</beanvalidation-version>
{{/useBeanValidation}}
<junit-version>5.10.3</junit-version>
<junit-platform-runner.version>1.10.0</junit-platform-runner.version>
<jakarta.ws.rs-api-version>2.1.6</jakarta.ws.rs-api-version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import io.swagger.v3.oas.annotations.security.*;
{{/swagger2AnnotationLibrary}}

{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;
{{/useBeanValidation}}

import java.lang.reflect.Type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import java.util.List;
import java.util.Map;

{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;

{{/useBeanValidation}}
import static io.restassured.config.ObjectMapperConfig.objectMapperConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,12 @@
{{/jackson}}
{{#useJakartaEe}}
<jakarta-annotation-version>2.1.1</jakarta-annotation-version>
<beanvalidation-version>3.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{^useJakartaEe}}
<jakarta-annotation-version>1.3.5</jakarta-annotation-version>
<beanvalidation-version>2.0.2</beanvalidation-version>
{{/useJakartaEe}}
{{#useBeanValidation}}
<beanvalidation-version>3.0.2</beanvalidation-version>
{{/useBeanValidation}}
<okio-version>3.6.0</okio-version>
<junit-version>5.10.3</junit-version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;

{{#useBeanValidation}}
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;

{{/useBeanValidation}}
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,24 @@ package {{package}};

{{#imports}}import {{import}};
{{/imports}}
import org.junit.Test;
import org.junit.Ignore;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

{{#useBeanValidation}}
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;

{{/useBeanValidation}}
/**
* API tests for {{classname}}
*/
@Ignore
@Disabled
public class {{classname}}Test {
private final {{classname}} api = new {{classname}}();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,7 @@
{{#joda}}
<jodatime-version>2.9.9</jodatime-version>
{{/joda}}
{{#useBeanValidation}}
<beanvalidation-version>3.0.2</beanvalidation-version>
{{/useBeanValidation}}
{{#performBeanValidation}}
<hibernate-validator-version>5.4.3.Final</hibernate-validator-version>
{{/performBeanValidation}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import java.util.Map;
import java.util.stream.Collectors;

{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;

{{/useBeanValidation}}
import org.springframework.beans.factory.annotation.Autowired;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import java.util.List;
import java.util.Map;

{{#useBeanValidation}}
import jakarta.validation.constraints.*;
import jakarta.validation.Valid;
import {{javaxPackage}}.validation.constraints.*;
import {{javaxPackage}}.validation.Valid;

{{/useBeanValidation}}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,12 @@ ext {
{{#useJakartaEe}}
spring_web_version = "6.1.5"
jakarta_annotation_version = "2.1.1"
beanvalidation_version = "3.0.2"
{{/useJakartaEe}}
{{^useJakartaEe}}
spring_web_version = "5.3.33"
jakarta_annotation_version = "1.3.5"
beanvalidation_version = "2.0.2"
{{/useJakartaEe}}
jodatime_version = "2.9.9"
junit_version = "5.10.2"
Expand Down
Loading
Loading