diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/bots/BotsResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/bots/BotsResource.java index 5afd819f221..19aebd31d5e 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/bots/BotsResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/bots/BotsResource.java @@ -24,6 +24,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import java.io.IOException; import java.util.List; import java.util.UUID; +import javax.validation.Valid; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.ws.rs.Consumes; @@ -127,7 +128,7 @@ public class BotsResource extends EntityResource { content = @Content(mediaType = "application/json", schema = @Schema(implementation = Bots.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) - public Response create(@Context UriInfo uriInfo, @Context SecurityContext securityContext, Bots bot) + public Response create(@Context UriInfo uriInfo, @Context SecurityContext securityContext, @Valid Bots bot) throws IOException { bot.withId(UUID.randomUUID()) .withUpdatedBy(securityContext.getUserPrincipal().getName()) diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/databases/TableResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/databases/TableResource.java index e1f9df0b0b4..2e04ec6faba 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/databases/TableResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/databases/TableResource.java @@ -395,7 +395,7 @@ public class TableResource extends EntityResource { @Context UriInfo uriInfo, @Context SecurityContext securityContext, @Parameter(description = "Id of the table", schema = @Schema(type = "string")) @PathParam("id") String id, - TableJoins joins) + @Valid TableJoins joins) throws IOException { SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT); Table table = dao.addJoins(UUID.fromString(id), joins); @@ -409,7 +409,7 @@ public class TableResource extends EntityResource { @Context UriInfo uriInfo, @Context SecurityContext securityContext, @Parameter(description = "Id of the table", schema = @Schema(type = "string")) @PathParam("id") String id, - TableData tableData) + @Valid TableData tableData) throws IOException { SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT); Table table = dao.addSampleData(UUID.fromString(id), tableData); @@ -423,7 +423,7 @@ public class TableResource extends EntityResource { @Context UriInfo uriInfo, @Context SecurityContext securityContext, @Parameter(description = "Id of the table", schema = @Schema(type = "string")) @PathParam("id") String id, - TableProfile tableProfile) + @Valid TableProfile tableProfile) throws IOException { SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT); Table table = dao.addTableProfileData(UUID.fromString(id), tableProfile); @@ -457,7 +457,7 @@ public class TableResource extends EntityResource { @Context UriInfo uriInfo, @Context SecurityContext securityContext, @Parameter(description = "Id of the table", schema = @Schema(type = "string")) @PathParam("id") String id, - SQLQuery sqlQuery) + @Valid SQLQuery sqlQuery) throws IOException { SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT); Table table = dao.addQuery(UUID.fromString(id), sqlQuery); @@ -474,7 +474,7 @@ public class TableResource extends EntityResource { @Context UriInfo uriInfo, @Context SecurityContext securityContext, @Parameter(description = "Id of the table", schema = @Schema(type = "string")) @PathParam("id") String id, - DataModel dataModel) + @Valid DataModel dataModel) throws IOException { SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT); Table table = dao.addDataModel(UUID.fromString(id), dataModel); @@ -488,7 +488,7 @@ public class TableResource extends EntityResource { @Context UriInfo uriInfo, @Context SecurityContext securityContext, @Parameter(description = "Id of the table", schema = @Schema(type = "string")) @PathParam("id") String id, - CreateTableTest createTableTest) + @Valid CreateTableTest createTableTest) throws IOException { SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT); TableTest tableTest = getTableTest(securityContext, createTableTest); @@ -518,7 +518,7 @@ public class TableResource extends EntityResource { @Context UriInfo uriInfo, @Context SecurityContext securityContext, @Parameter(description = "Id of the table", schema = @Schema(type = "string")) @PathParam("id") String id, - CreateColumnTest createColumnTest) + @Valid CreateColumnTest createColumnTest) throws IOException { SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT); ColumnTest columnTest = getColumnTest(securityContext, createColumnTest); @@ -533,7 +533,7 @@ public class TableResource extends EntityResource { @Context UriInfo uriInfo, @Context SecurityContext securityContext, @Parameter(description = "Id of the table", schema = @Schema(type = "string")) @PathParam("id") String id, - CreateCustomMetric createCustomMetric) + @Valid CreateCustomMetric createCustomMetric) throws IOException { SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT); CustomMetric customMetric = getCustomMetric(securityContext, createCustomMetric); diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/pipelines/PipelineResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/pipelines/PipelineResource.java index 0b4a4ff558e..fbfb82ae4be 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/pipelines/PipelineResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/pipelines/PipelineResource.java @@ -344,7 +344,7 @@ public class PipelineResource extends EntityResource