Skip to content

Commit

Permalink
Fix duplicate spring doc tags.
Browse files Browse the repository at this point in the history
Ensure that all tags have the same description.
  • Loading branch information
ianwallen authored and fxprunayre committed Jan 2, 2024
1 parent a54f3d5 commit 0223ed2
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 15 deletions.
4 changes: 4 additions & 0 deletions services/src/main/java/org/fao/geonet/api/ApiParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public class ApiParams {
public static final String API_CLASS_CATALOG_TAG = "site";
public static final String API_CLASS_REGISTRIES_OPS = "Registries related operations";
public static final String API_CLASS_REGISTRIES_TAG = "registries";
public static final String API_CLASS_TOOLS_TAG = "tools";
public static final String API_CLASS_TOOLS_OPS = "Utility operations";
public static final String API_CLASS_FORMATTERS_TAG = "formatters";
public static final String API_CLASS_FORMATTERS_OPS = "Formatter operations";


public static final String API_PARAM_RECORD_UUID = "Record UUID.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import javax.servlet.http.HttpSession;
import java.util.Map;

import static org.fao.geonet.api.ApiParams.API_CLASS_RECORD_OPS;
import static org.fao.geonet.api.ApiParams.API_CLASS_RECORD_TAG;
import static org.fao.geonet.api.ApiParams.API_PARAM_RECORD_UUID;

Expand All @@ -57,7 +58,8 @@
@RequestMapping(value = {
"/{portal}/api/records"
})
@Tag(name = API_CLASS_RECORD_TAG)
@Tag(name = API_CLASS_RECORD_TAG,
description = API_CLASS_RECORD_OPS)
@Controller("doi")
@PreAuthorize("hasAuthority('Editor')")
@ReadWriteController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,16 @@
import java.util.HashMap;
import java.util.Map;

import static org.fao.geonet.api.ApiParams.API_CLASS_RECORD_OPS;
import static org.fao.geonet.api.ApiParams.API_CLASS_RECORD_TAG;
import static org.fao.geonet.api.ApiParams.API_PARAM_RECORD_UUID;


@RequestMapping(value = {
"/{portal}/api/records"
})
@Tag(name = API_CLASS_RECORD_TAG)
@Tag(name = API_CLASS_RECORD_TAG,
description = API_CLASS_RECORD_OPS)
@Controller("inspire")
@PreAuthorize("hasAuthority('Editor')")
@ReadWriteController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@
import javax.servlet.http.HttpServletRequest;
import java.nio.file.Path;

import static org.fao.geonet.api.ApiParams.API_CLASS_RECORD_OPS;
import static org.fao.geonet.api.ApiParams.API_CLASS_RECORD_TAG;
import static org.fao.geonet.api.ApiParams.API_PARAM_RECORD_UUID;

@EnableWebMvc
@Controller
@Service
@Tag(name = "records",
description = "Metadata record operations")
@Tag(name = API_CLASS_RECORD_TAG,
description = API_CLASS_RECORD_OPS)
public class AttachmentsActionsApi {
private final ApplicationContext appContext = ApplicationContextHolder.get();
@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

package org.fao.geonet.api.records.attachments;

import static org.fao.geonet.api.ApiParams.API_CLASS_RECORD_OPS;
import static org.fao.geonet.api.ApiParams.API_CLASS_RECORD_TAG;

import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
Expand Down Expand Up @@ -80,7 +83,8 @@
@EnableWebMvc
@Service
@RequestMapping(value = {"/{portal}/api/records/{metadataUuid}/attachments"})
@Tag(name = "records", description = "Metadata record operations")
@Tag(name = API_CLASS_RECORD_TAG,
description = API_CLASS_RECORD_OPS)
public class AttachmentsApi {
public static final Integer MIN_IMAGE_SIZE = 1;
public static final Integer MAX_IMAGE_SIZE = 2048;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

package org.fao.geonet.api.records.formatters;

import static org.fao.geonet.api.ApiParams.API_CLASS_FORMATTERS_OPS;
import static org.fao.geonet.api.ApiParams.API_CLASS_FORMATTERS_TAG;

import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
Expand All @@ -40,8 +43,8 @@
@RequestMapping(value = {
"/{portal}/api/formatters"
})
@Tag(name = "formatters",
description = "Formatter operations")
@Tag(name = API_CLASS_FORMATTERS_TAG,
description = API_CLASS_FORMATTERS_OPS)
@Controller("formatters")
@ReadWriteController
public class CacheApi {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
import java.util.List;
import java.util.Set;

import static org.fao.geonet.api.ApiParams.API_CLASS_FORMATTERS_OPS;
import static org.fao.geonet.api.ApiParams.API_CLASS_FORMATTERS_TAG;
import static org.fao.geonet.api.records.formatters.FormatterConstants.SCHEMA_PLUGIN_FORMATTER_DIR;
import static org.fao.geonet.api.records.formatters.FormatterConstants.VIEW_XSL_FILENAME;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
Expand All @@ -82,8 +84,8 @@
*
* @author jeichar
*/
@Tag(name = "formatters",
description = "Formatter admin operations")
@Tag(name = API_CLASS_FORMATTERS_TAG,
description = API_CLASS_FORMATTERS_OPS)
@Controller("formattersList")
public class FormatterAdminApi extends AbstractFormatService {

Expand Down
7 changes: 5 additions & 2 deletions services/src/main/java/org/fao/geonet/api/sld/SldApi.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.fao.geonet.api.sld;

import static org.fao.geonet.api.ApiParams.API_CLASS_TOOLS_OPS;
import static org.fao.geonet.api.ApiParams.API_CLASS_TOOLS_TAG;

import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jeeves.transaction.TransactionManager;
Expand Down Expand Up @@ -47,8 +50,8 @@
@RequestMapping(value = {
"/{portal}/api/tools/ogc"
})
@Tag(name = "tools",
description = "Utility operations")
@Tag(name = API_CLASS_TOOLS_TAG,
description = API_CLASS_TOOLS_OPS)
public class SldApi {

public static final String LOGGER = Geonet.GEONETWORK + ".api.sld";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
import java.util.stream.Collectors;

import static java.util.stream.Collectors.groupingBy;
import static org.fao.geonet.api.ApiParams.API_CLASS_TOOLS_OPS;
import static org.fao.geonet.api.ApiParams.API_CLASS_TOOLS_TAG;
import static org.springframework.http.HttpStatus.CREATED;
import static org.springframework.http.HttpStatus.OK;

Expand All @@ -61,7 +63,8 @@
@RequestMapping(value = {
"/{portal}/api/i18n"
})
@Tag(name = "tools")
@Tag(name = API_CLASS_TOOLS_TAG,
description = API_CLASS_TOOLS_OPS)
@RestController
public class TranslationApi {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
//=== Rome - Italy. email: [email protected]
//==============================================================================

import static org.fao.geonet.api.ApiParams.API_CLASS_TOOLS_OPS;
import static org.fao.geonet.api.ApiParams.API_CLASS_TOOLS_TAG;

import io.swagger.v3.oas.annotations.tags.Tag;
import org.fao.geonet.api.API;
import org.fao.geonet.api.tools.i18n.LanguageUtils;
Expand Down Expand Up @@ -73,8 +76,8 @@
@RequestMapping(value = {
"/{portal}/api/tools/mail"
})
@Tag(name = "tools",
description = "Utility operations")
@Tag(name = API_CLASS_TOOLS_TAG,
description = API_CLASS_TOOLS_OPS)
@Controller("mail")
public class MailApi {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

package org.fao.geonet.api.tools.migration;

import static org.fao.geonet.api.ApiParams.API_CLASS_TOOLS_OPS;
import static org.fao.geonet.api.ApiParams.API_CLASS_TOOLS_TAG;

import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.fao.geonet.ApplicationContextHolder;
Expand All @@ -43,7 +46,8 @@
@RequestMapping(value = {
"/{portal}/api/tools/migration"
})
@Tag(name = "tools")
@Tag(name = API_CLASS_TOOLS_TAG,
description = API_CLASS_TOOLS_OPS)
@RestController
public class MigrationApi {

Expand Down

0 comments on commit 0223ed2

Please sign in to comment.