diff --git a/webservice/src/main/java/life/catalogue/resources/VocabResource.java b/webservice/src/main/java/life/catalogue/resources/VocabResource.java index 7c5b018e2..762cb77c1 100644 --- a/webservice/src/main/java/life/catalogue/resources/VocabResource.java +++ b/webservice/src/main/java/life/catalogue/resources/VocabResource.java @@ -105,7 +105,7 @@ public List list() { @GET @Path("term") - public List terms(@QueryParam("prefix") String prefix) { + public List terms(@QueryParam("prefix") String prefix, @QueryParam("classOnly") boolean classOnly) { Set> classes = new HashSet<>( TermFactory.instance().listRegisteredTermEnums() ); if (prefix != null) { prefix = prefix.toLowerCase().trim(); @@ -122,7 +122,9 @@ public List terms(@QueryParam("prefix") String pr for (Class clazz : classes) { Class tec = (Class) clazz; for (TE te : tec.getEnumConstants()) { - terms.add(te); + if (!classOnly || te.isClass()) { + terms.add(te); + } } }