Return only project description on PUT on '/projects/*/description'
In a REST API the result of PUT on a URL should generally be the same as the result of a GET on the URL after the PUT was completed. Since GET on '/projects/*/description' returns only the project description, PUT on '/projects/*/description' should also only return the project description. Change-Id: I3a12e94435e8618ef5f6486ec8e6891294f08159 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
@@ -54,7 +54,7 @@ class SetDescription implements RestModifyView<ProjectResource, Input> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object apply(ProjectResource resource, Input input)
|
public String apply(ProjectResource resource, Input input)
|
||||||
throws AuthException, BadRequestException, ResourceConflictException,
|
throws AuthException, BadRequestException, ResourceConflictException,
|
||||||
Exception {
|
Exception {
|
||||||
if (input == null) {
|
if (input == null) {
|
||||||
@@ -88,11 +88,7 @@ class SetDescription implements RestModifyView<ProjectResource, Input> {
|
|||||||
resource.getNameKey(),
|
resource.getNameKey(),
|
||||||
project.getDescription());
|
project.getDescription());
|
||||||
|
|
||||||
ListProjects.ProjectInfo info = new ListProjects.ProjectInfo();
|
return project.getDescription();
|
||||||
info.setName(resource.getName());
|
|
||||||
info.parent = project.getParentName();
|
|
||||||
info.description = project.getDescription();
|
|
||||||
return info;
|
|
||||||
} finally {
|
} finally {
|
||||||
md.close();
|
md.close();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user