@Operation(summary = "Fetch service either by numeric id or service id pattern")
    @GetMapping(path = "{id}", produces = {
        MediaType.APPLICATION_JSON_VALUE,
        MEDIA_TYPE_SPRING_BOOT_V2_JSON,
        MEDIA_TYPE_SPRING_BOOT_V3_JSON,
        MediaType.APPLICATION_FORM_URLENCODED_VALUE,
        MEDIA_TYPE_CAS_YAML
    })
    public ResponseEntity<String> fetchService(
        @PathVariable
        final String id) throws Exception {
        val service = NumberUtils.isDigits(id)
            ? servicesManager.getObject().findServiceBy(Long.parseLong(id))
            : servicesManager.getObject().findServiceBy(configurationContext.getObject().getServiceFactory().createService(id));
        if (service == null) {
            return ResponseEntity.notFound().build();
        }
        return ResponseEntity.ok(MAPPER.writeValueAsString(service));
    }
Fetch service either by numeric id or service id pattern.

@param id the id
@return the registered service
@throws Exception the exception
support/cas-server-support-reports-core/src/main/java/org/apereo/cas/web/report/RegisteredServicesEndpoint.java