Conversation
…dependencies in pom.xml
…lity, and include unit tests
📊 Static Analysis Summary🔍 Code Quality Checks
📦 Download detailed reports from the workflow artifacts. |
…m PersistenceTestApplication
📊 Static Analysis Summary🔍 Code Quality Checks
📦 Download detailed reports from the workflow artifacts. |
…d global Jackson configuration
📊 Static Analysis Summary🔍 Code Quality Checks
📦 Download detailed reports from the workflow artifacts. |
| @@ -1,15 +1,34 @@ | |||
| package org.opendevstack.apiservice.project.mapper; | |||
There was a problem hiding this comment.
Something like this is more close to the use of MapStuct
package org.opendevstack.apiservice.project.mapper;
import org.apache.commons.lang3.StringUtils;
import org.mapstruct.*;
import org.opendevstack.apiservice.project.model.CreateProjectRequest;
import org.opendevstack.apiservice.project.model.CreateProjectResponse;
import org.opendevstack.apiservice.serviceproject.model.ProjectRequest;
import org.opendevstack.apiservice.serviceproject.model.ProjectResponse;
@Mapper(
componentModel = "spring",
unmappedTargetPolicy = ReportingPolicy.ERROR,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS
)
public interface ProjectMapper {
// API -> Service
ProjectRequest toServiceRequest(CreateProjectRequest apiRequest);
// Service -> API (mapeo base)
@Mapping(target = "projectKey", source = "projectKey")
@Mapping(target = "status", source = "status", qualifiedByName = "emptyToNull")
// location in @AfterMapping so you have the projectkey value mappend if exists.
CreateProjectResponse toApiResponse(ProjectResponse serviceResponse);
// Helper: mapd"" -> null (not empty string )
@Named("emptyToNull")
default String emptyToNull(String value) {
return StringUtils.isBlank(value) ? null : value.trim();
}
// Post-processing: location composed if projectkey exists
@AfterMapping
default void buildLocation(@MappingTarget CreateProjectResponse target, ProjectResponse source) {
if (StringUtils.isNotBlank(source.getProjectKey())) {
target.setLocation("/api/pub/v0/projects/" + source.getProjectKey().trim());
}
}
}
|
|
||
| @SpringBootApplication(scanBasePackages = { "org.opendevstack.apiservice" }) | ||
| @EnableCaching | ||
| @EntityScan(basePackages = "org.opendevstack.apiservice.persistence.entity") |
There was a problem hiding this comment.
@AutoConfigurationPackage(basePackages = { "org.opendevstack.apiservice" })
Check if it works with the auto without the EntityScan, maybe is not searching in the right places.
jorge-romero
left a comment
There was a problem hiding this comment.
have a look at my comment
…d refactor repository methods for case-insensitive project key lookup
📊 Static Analysis Summary🔍 Code Quality Checks
📦 Download detailed reports from the workflow artifacts. |
…rove error messages in ProjectController and ProjectResponseFactory
📊 Static Analysis Summary🔍 Code Quality Checks
📦 Download detailed reports from the workflow artifacts. |
📊 Static Analysis Summary🔍 Code Quality Checks
📦 Download detailed reports from the workflow artifacts. |
|
📊 Static Analysis Summary🔍 Code Quality Checks
📦 Download detailed reports from the workflow artifacts. |
This reverts commit 8f7c7fa.



No description provided.