Skip to content

Commit

Permalink
fix v2 api endpoints broken
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesamcl committed Oct 17, 2022
1 parent ede931e commit 3c55e59
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import javax.validation.constraints.Pattern;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;

@Controller
Expand Down Expand Up @@ -62,7 +63,7 @@ public HttpEntity<PagedResources<V2Class>> getClasses(
PagedResourcesAssembler assembler
) throws ResourceNotFoundException, IOException {

Map<String,String> properties = Map.of("isObsolete", "false");
Map<String,String> properties = new HashMap<>(Map.of("isObsolete", "false"));
properties.putAll(searchProperties);

Page<V2Class> document = classRepository.find(pageable, lang, search, searchFields, DynamicQueryHelper.filterProperties(properties));
Expand All @@ -81,7 +82,7 @@ public HttpEntity<PagedResources<V2Class>> getClasses(
PagedResourcesAssembler assembler
) throws ResourceNotFoundException, IOException {

Map<String,String> properties = Map.of("isObsolete", "false");
Map<String,String> properties = new HashMap<>(Map.of("isObsolete", "false"));
properties.putAll(searchProperties);

Page<V2Class> document = classRepository.findByOntologyId(ontologyId, pageable, lang, search, searchFields, DynamicQueryHelper.filterProperties(properties));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import javax.validation.constraints.NotNull;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;

@Controller
Expand Down Expand Up @@ -60,7 +61,7 @@ public HttpEntity<PagedResources<V2Entity>> getEntities(
PagedResourcesAssembler assembler
) throws ResourceNotFoundException, IOException {

Map<String,String> properties = Map.of("isObsolete", "false");
Map<String,String> properties = new HashMap<>(Map.of("isObsolete", "false"));
properties.putAll(searchProperties);

Page<V2Entity> document = entityRepository.find(pageable, lang, search, searchFields, DynamicQueryHelper.filterProperties(properties));
Expand All @@ -79,7 +80,7 @@ public HttpEntity<PagedResources<V2Entity>> getTerms(
PagedResourcesAssembler assembler
) throws ResourceNotFoundException, IOException {

Map<String,String> properties = Map.of("isObsolete", "false");
Map<String,String> properties = new HashMap<>(Map.of("isObsolete", "false"));
properties.putAll(searchProperties);

Page<V2Entity> document = entityRepository.findByOntologyId(ontologyId, pageable, lang, search, searchFields, DynamicQueryHelper.filterProperties(properties));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

@Controller
Expand Down Expand Up @@ -61,7 +62,7 @@ public HttpEntity<PagedResources<V2Individual>> getIndividuals(
PagedResourcesAssembler assembler
) throws ResourceNotFoundException, IOException {

Map<String,String> properties = Map.of("isObsolete", "false");
Map<String,String> properties = new HashMap<>(Map.of("isObsolete", "false"));
properties.putAll(searchProperties);

Page<V2Individual> document = individualRepository.find(pageable, lang, search, searchFields, DynamicQueryHelper.filterProperties(properties));
Expand All @@ -80,7 +81,7 @@ public HttpEntity<PagedResources<V2Individual>> getIndividuals(
PagedResourcesAssembler assembler
) throws ResourceNotFoundException, IOException {

Map<String,String> properties = Map.of("isObsolete", "false");
Map<String,String> properties = new HashMap<>(Map.of("isObsolete", "false"));
properties.putAll(searchProperties);

Page<V2Individual> document = individualRepository.findByOntologyId(ontologyId, pageable, lang, search, searchFields, DynamicQueryHelper.filterProperties(properties));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public HttpEntity<PagedResources<V2Ontology>> getOntologies(
PagedResourcesAssembler assembler
) throws ResourceNotFoundException, IOException {

Map<String,String> properties = Map.of("isObsolete", "false");
Map<String,String> properties = new HashMap<>(Map.of("isObsolete", "false"));
properties.putAll(searchProperties);

Page<V2Ontology> document = ontologyRepository.find(pageable, lang, search, searchFields, DynamicQueryHelper.filterProperties(properties));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

@Controller
Expand Down Expand Up @@ -60,7 +61,7 @@ public HttpEntity<PagedResources<V2Property>> getProperties(
PagedResourcesAssembler assembler
) throws ResourceNotFoundException, IOException {

Map<String,String> properties = Map.of("isObsolete", "false");
Map<String,String> properties = new HashMap<>(Map.of("isObsolete", "false"));
properties.putAll(searchProperties);

Page<V2Property> document = propertyRepository.find(pageable, lang, search, searchFields, DynamicQueryHelper.filterProperties(properties));
Expand All @@ -79,7 +80,7 @@ public HttpEntity<PagedResources<V2Property>> getProperties(
PagedResourcesAssembler assembler
) throws ResourceNotFoundException, IOException {

Map<String,String> properties = Map.of("isObsolete", "false");
Map<String,String> properties = new HashMap<>(Map.of("isObsolete", "false"));
properties.putAll(searchProperties);

Page<V2Property> document = propertyRepository.findByOntologyId(ontologyId, pageable, lang, search, searchFields, DynamicQueryHelper.filterProperties(properties));
Expand Down

0 comments on commit 3c55e59

Please sign in to comment.