import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.servers.Server;
-import io.swagger.v3.oas.annotations.servers.Servers;
import io.swagger.v3.oas.annotations.tags.Tag;
-import io.swagger.v3.oas.annotations.tags.Tags;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
@Loggable(prepend = true, value = Loggable.DEBUG, trim = false)
@Path("/v1/catalog")
-@Tags({@Tag(name = "SDC Internal APIs")})
-@Servers({@Server(url = "/sdc2/rest")})
+@Tag(name = "SDCE-2 APIs")
+@Server(url = "/sdc2/rest")
@Singleton
public class ComponentPropertyServlet extends BeGenericServlet {
ResponseFormat responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.INVALID_CONTENT);
return buildErrorResponse(responseFormat);
}
- //Validate value and Constraint of property
- Either<Boolean, ResponseFormat> constraintValidatorResponse = PropertyValueConstraintValidationUtil.getInstance()
- .validatePropertyConstraints(properties.values(), applicationDataTypeCache);
+ //Validate value and Constraint of property and Fetch all data types from cache
+ Either<Boolean, ResponseFormat> constraintValidatorResponse = new PropertyValueConstraintValidationUtil()
+ .validatePropertyConstraints(properties.values(), applicationDataTypeCache,
+ propertyBusinessLogic.getComponentModelByComponentId(componentId));
if (constraintValidatorResponse.isRight()) {
log.error("Failed validation value and constraint of property: {}", constraintValidatorResponse.right().value());
return buildErrorResponse(constraintValidatorResponse.right().value());
Either<EntryData<String, PropertyDefinition>, ResponseFormat> status = propertyBusinessLogic
.updateComponentProperty(componentId, propertyDefinition.getUniqueId(), propertyDefinition, userId);
if (status.isRight()) {
- log.info("Failed to update Property. Reason - ", status.right().value());
+ log.info("Failed to update Property. Reason - {}", status.right().value());
return buildErrorResponse(status.right().value());
}
EntryData<String, PropertyDefinition> property = status.left().value();