Skip to content

Commit

Permalink
trimming tag names
Browse files Browse the repository at this point in the history
  • Loading branch information
marcos-lg committed Jun 10, 2024
1 parent 5aecdce commit 1e917d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@
RequestHeaderParamUpdateFilter.class
})
@ComponentScan(
basePackages = {"org.gbif.vocabulary.restws", "org.gbif.ws.remoteauth"},
basePackages = {
"org.gbif.vocabulary.restws",
"org.gbif.ws.remoteauth",
"org.gbif.ws.server.interceptor"
},
excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE)})
@EnableConfigurationProperties({
ExportConfig.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
package org.gbif.vocabulary.restws.resources;

import org.gbif.api.annotation.Trim;
import org.gbif.api.model.common.paging.Pageable;
import org.gbif.api.model.common.paging.PagingResponse;
import org.gbif.vocabulary.model.Tag;
Expand Down Expand Up @@ -97,7 +98,7 @@ public Tag getTag(@PathVariable("name") String tagName) {
@Docs.DefaultUnsuccessfulReadResponses
@Docs.DefaultUnsuccessfulWriteResponses
@PostMapping
public Tag create(@RequestBody Tag tag) {
public Tag create(@RequestBody @Trim Tag tag) {
int key = tagService.create(tag);
return tagService.get(key);
}
Expand All @@ -115,7 +116,7 @@ public Tag create(@RequestBody Tag tag) {
@Docs.DefaultUnsuccessfulReadResponses
@Docs.DefaultUnsuccessfulWriteResponses
@PutMapping("{name}")
public Tag update(@PathVariable("name") String tagName, @RequestBody Tag tag) {
public Tag update(@PathVariable("name") String tagName, @RequestBody @Trim Tag tag) {
Tag oldTag = tagService.getByName(tagName);
checkArgument(oldTag != null, "Tag not found for name " + tagName);
checkArgument(
Expand Down

0 comments on commit 1e917d0

Please sign in to comment.