diff --git a/.github/workflows/fit_Elasticsearch.yml b/.github/workflows/fit_Elasticsearch.yml index de404fd3d8a..5c555b79141 100644 --- a/.github/workflows/fit_Elasticsearch.yml +++ b/.github/workflows/fit_Elasticsearch.yml @@ -41,5 +41,5 @@ jobs: maven-version: 3.9.6 - name: Build run: mvn -U -T 1C -P 'skipTests,all' - - name: 'Elasticsearch / PostgreSQL / JSON' + - name: 'Elasticsearch / PostgreSQL' run: mvn -f fit/core-reference/pom.xml -P elasticsearch-it -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true diff --git a/.github/workflows/fit_OpenSearch.yml b/.github/workflows/fit_OpenSearch.yml index 6aa5d93683e..7d69bc388d2 100644 --- a/.github/workflows/fit_OpenSearch.yml +++ b/.github/workflows/fit_OpenSearch.yml @@ -41,5 +41,5 @@ jobs: maven-version: 3.9.6 - name: Build run: mvn -U -T 1C -P 'skipTests,all' - - name: 'OpenSearch / PostgreSQL / JSON' + - name: 'OpenSearch / PostgreSQL' run: mvn -f fit/core-reference/pom.xml -P opensearch-it -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true diff --git a/.github/workflows/fit_Payara.yml b/.github/workflows/fit_Payara.yml index 56601c4d9ea..ae6de3868d4 100644 --- a/.github/workflows/fit_Payara.yml +++ b/.github/workflows/fit_Payara.yml @@ -41,5 +41,5 @@ jobs: maven-version: 3.9.6 - name: Build run: mvn -U -T 1C -P 'skipTests,all' - - name: 'Payara / PostgreSQL / JSON' + - name: 'Payara / PostgreSQL' run: mvn -f fit/core-reference/pom.xml -P payara-it -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true diff --git a/.github/workflows/fit_Tomcat_PostgreSQL_JSON.yml b/.github/workflows/fit_Tomcat_PostgreSQL.yml similarity index 93% rename from .github/workflows/fit_Tomcat_PostgreSQL_JSON.yml rename to .github/workflows/fit_Tomcat_PostgreSQL.yml index c00c64684a8..1058101e800 100644 --- a/.github/workflows/fit_Tomcat_PostgreSQL_JSON.yml +++ b/.github/workflows/fit_Tomcat_PostgreSQL.yml @@ -14,7 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License -name: "FIT Tomcat PostgreSQL JSON" +name: "FIT Tomcat PostgreSQL" on: push: @@ -24,7 +24,7 @@ on: branches: [master] jobs: - fit_Tomcat_PostgreSQL_JSON: + fit_Tomcat_PostgreSQL: runs-on: ubuntu-latest steps: @@ -41,5 +41,5 @@ jobs: maven-version: 3.9.6 - name: Build run: mvn -U -T 1C -P 'skipTests,all' - - name: 'Tomcat / PostgreSQL / JSON' + - name: 'Tomcat / PostgreSQL' run: mvn -f fit/core-reference/pom.xml verify -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true diff --git a/.github/workflows/fit_Tomcat_PostgreSQL_XML.yml b/.github/workflows/fit_Tomcat_PostgreSQL_XML.yml deleted file mode 100644 index 2f454b7d967..00000000000 --- a/.github/workflows/fit_Tomcat_PostgreSQL_XML.yml +++ /dev/null @@ -1,45 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License -name: "FIT Tomcat PostgreSQL XML" - -on: - push: - branches: [master] - pull_request: - # The branches below must be a subset of the branches above - branches: [master] - -jobs: - fit_Tomcat_PostgreSQL_XML: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - name: Setup Java JDK - uses: actions/setup-java@v5 - with: - distribution: 'temurin' - java-version: 21 - - name: Setup Maven - uses: stCarolas/setup-maven@v5 - with: - maven-version: 3.9.6 - - name: Build - run: mvn -U -T 1C -P 'skipTests,all' - - name: 'Tomcat / PostgreSQL / XML' - run: mvn -f fit/core-reference/pom.xml verify -Djaxrs.content.type=application/xml -Dit.test=org.apache.syncope.fit.core.*ITCase -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true diff --git a/.github/workflows/fit_Tomcat_PostgreSQL_YAML.yml b/.github/workflows/fit_Tomcat_PostgreSQL_YAML.yml deleted file mode 100644 index 6e7fa3918bb..00000000000 --- a/.github/workflows/fit_Tomcat_PostgreSQL_YAML.yml +++ /dev/null @@ -1,45 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License -name: "FIT Tomcat PostgreSQL YAML" - -on: - push: - branches: [master] - pull_request: - # The branches below must be a subset of the branches above - branches: [master] - -jobs: - fit_Tomcat_PostgreSQL_YAML: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v6 - - name: Setup Java JDK - uses: actions/setup-java@v5 - with: - distribution: 'temurin' - java-version: 21 - - name: Setup Maven - uses: stCarolas/setup-maven@v5 - with: - maven-version: 3.9.6 - - name: Build - run: mvn -U -T 1C -P 'skipTests,all' - - name: 'Tomcat / PostgreSQL / YAML' - run: mvn -f fit/core-reference/pom.xml verify -Djaxrs.content.type=application/yaml -Dit.test=org.apache.syncope.fit.core.*ITCase -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true diff --git a/.github/workflows/fit_Wildfly.yml b/.github/workflows/fit_Wildfly.yml index 603ece0bbeb..2936d90a82a 100644 --- a/.github/workflows/fit_Wildfly.yml +++ b/.github/workflows/fit_Wildfly.yml @@ -41,5 +41,5 @@ jobs: maven-version: 3.9.6 - name: Build run: mvn -U -T 1C -P 'skipTests,all' - - name: 'Wildfly / PostgreSQL / JSON' + - name: 'Wildfly / PostgreSQL' run: mvn -f fit/core-reference/pom.xml -P wildfly-it -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true diff --git a/.github/workflows/fit_Zookeeper.yml b/.github/workflows/fit_Zookeeper.yml index a0e6f5824ed..9d733a59155 100644 --- a/.github/workflows/fit_Zookeeper.yml +++ b/.github/workflows/fit_Zookeeper.yml @@ -41,5 +41,5 @@ jobs: maven-version: 3.9.6 - name: Build run: mvn -U -T 1C -P 'skipTests,all' - - name: 'Zookeeper / PostgreSQL / JSON' + - name: 'Zookeeper / PostgreSQL' run: mvn -f fit/core-reference/pom.xml -P zookeeper-it -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true diff --git a/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/markup/html/form/preview/BinaryTextPreviewer.java b/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/markup/html/form/preview/BinaryTextPreviewer.java index 7220f616d68..7e104d325f2 100644 --- a/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/markup/html/form/preview/BinaryTextPreviewer.java +++ b/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/markup/html/form/preview/BinaryTextPreviewer.java @@ -23,7 +23,6 @@ import java.io.IOException; import java.io.InputStream; import org.apache.syncope.client.ui.commons.annotations.BinaryPreview; -import org.apache.syncope.common.rest.api.RESTHeaders; import org.apache.wicket.Component; import org.apache.wicket.markup.head.IHeaderResponse; import org.apache.wicket.markup.head.OnLoadHeaderItem; @@ -34,7 +33,7 @@ import org.apache.wicket.util.io.IOUtils; @BinaryPreview(mimeTypes = { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, - RESTHeaders.APPLICATION_YAML, "application/x-yaml", "text/x-yaml", "text/yaml" }) + "application/yaml", "application/x-yaml", "text/x-yaml", "text/yaml" }) public class BinaryTextPreviewer extends BinaryPreviewer { private static final long serialVersionUID = 3808379310090668773L; @@ -81,7 +80,7 @@ public void renderHead(final IHeaderResponse response) { options = "autoCloseTags: true, mode: 'text/html',"; break; - case RESTHeaders.APPLICATION_YAML: + case "application/yaml": case "application/x-yaml": case "text/x-yaml": case "text/yaml": diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java index 569835e0db6..72aeb6977a2 100644 --- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java +++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java @@ -166,10 +166,6 @@ public void onException(final Exception e) { error(message.replace("\n", "
")); } - public MediaType getMediaType() { - return clientFactory.getContentType().getMediaType(); - } - public void execute(final Runnable command) { try { executor.execute(command); diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/commons/LinkedAccountPlainAttrProperty.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/commons/LinkedAccountPlainAttrProperty.java index 6ce77c97fc5..4142dc697f1 100644 --- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/commons/LinkedAccountPlainAttrProperty.java +++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/commons/LinkedAccountPlainAttrProperty.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.client.console.commons; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -45,8 +43,6 @@ public void setSchema(final String schema) { this.schema = schema; } - @JacksonXmlElementWrapper(localName = "values") - @JacksonXmlProperty(localName = "value") public List getValues() { return values; } diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/rest/BaseRestClient.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/rest/BaseRestClient.java index 4ef2e0ae225..2d9698971b5 100644 --- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/rest/BaseRestClient.java +++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/rest/BaseRestClient.java @@ -19,6 +19,7 @@ package org.apache.syncope.client.console.rest; import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.MediaType; import java.net.URI; import java.util.Optional; import org.apache.cxf.jaxrs.client.WebClient; @@ -78,7 +79,7 @@ protected T getObject( final E service, final URI location, final Class resultClass) { WebClient webClient = WebClient.fromClient(WebClient.client(service)); - webClient.accept(SyncopeConsoleSession.get().getMediaType()).to(location.toASCIIString(), false); + webClient.accept(MediaType.APPLICATION_JSON).to(location.toASCIIString(), false); return webClient. header(RESTHeaders.DOMAIN, SyncopeConsoleSession.get().getDomain()). header(HttpHeaders.AUTHORIZATION, "Bearer " + SyncopeConsoleSession.get().getJWT()). diff --git a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserSession.java b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserSession.java index 34fdc501c53..a73be334563 100644 --- a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserSession.java +++ b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserSession.java @@ -177,10 +177,6 @@ public void onException(final Exception e) { error(message); } - public MediaType getMediaType() { - return clientFactory.getContentType().getMediaType(); - } - @Override public Future execute(final Callable command) { try { diff --git a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/rest/BaseRestClient.java b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/rest/BaseRestClient.java index 3d946a24dd9..d7d8fd0a8d8 100644 --- a/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/rest/BaseRestClient.java +++ b/client/idrepo/enduser/src/main/java/org/apache/syncope/client/enduser/rest/BaseRestClient.java @@ -19,6 +19,7 @@ package org.apache.syncope.client.enduser.rest; import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.MediaType; import java.net.URI; import org.apache.cxf.jaxrs.client.WebClient; import org.apache.syncope.client.enduser.SyncopeEnduserSession; @@ -77,7 +78,7 @@ protected T getObject( final E service, final URI location, final Class resultClass) { WebClient webClient = WebClient.fromClient(WebClient.client(service)); - webClient.accept(SyncopeEnduserSession.get().getMediaType()).to(location.toASCIIString(), false); + webClient.accept(MediaType.APPLICATION_JSON).to(location.toASCIIString(), false); return webClient. header(RESTHeaders.DOMAIN, SyncopeEnduserSession.get().getDomain()). header(HttpHeaders.AUTHORIZATION, "Bearer " + SyncopeEnduserSession.get().getJWT()). diff --git a/client/idrepo/lib/pom.xml b/client/idrepo/lib/pom.xml index 8e198d95f1a..3a576464dde 100644 --- a/client/idrepo/lib/pom.xml +++ b/client/idrepo/lib/pom.xml @@ -55,14 +55,6 @@ under the License. com.fasterxml.jackson.jakarta.rs jackson-jakarta-rs-json-provider - - com.fasterxml.jackson.jakarta.rs - jackson-jakarta-rs-xml-provider - - - com.fasterxml.jackson.jakarta.rs - jackson-jakarta-rs-yaml-provider - org.slf4j diff --git a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeAnonymousClient.java b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeAnonymousClient.java index fcd50a49c43..c703687722d 100644 --- a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeAnonymousClient.java +++ b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeAnonymousClient.java @@ -41,7 +41,6 @@ public class SyncopeAnonymousClient extends SyncopeClient { protected final AnonymousAuthenticationHandler anonymousAuthHandler; public SyncopeAnonymousClient( - final MediaType mediaType, final JAXRSClientFactoryBean restClientFactory, final RestClientExceptionMapper exceptionMapper, final AnonymousAuthenticationHandler anonymousAuthHandler, @@ -50,7 +49,6 @@ public SyncopeAnonymousClient( final TLSClientParameters tlsClientParameters) { super( - mediaType, restClientFactory, exceptionMapper, anonymousAuthHandler, diff --git a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java index c7dad8d0135..2b88c481f48 100644 --- a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java +++ b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClient.java @@ -216,8 +216,6 @@ public static EntityTag getLatestEntityTag(final T service) { protected static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build(); - protected final MediaType mediaType; - protected final JAXRSClientFactoryBean restClientFactory; protected final RestClientExceptionMapper exceptionMapper; @@ -229,7 +227,6 @@ public static EntityTag getLatestEntityTag(final T service) { protected final TLSClientParameters tlsClientParameters; public SyncopeClient( - final MediaType mediaType, final JAXRSClientFactoryBean restClientFactory, final RestClientExceptionMapper exceptionMapper, final AuthenticationHandler authHandler, @@ -237,7 +234,6 @@ public SyncopeClient( final HTTPClientPolicy httpClientPolicy, final TLSClientParameters tlsClientParameters) { - this.mediaType = mediaType; this.restClientFactory = restClientFactory; if (this.restClientFactory.getHeaders() == null) { this.restClientFactory.setHeaders(new HashMap<>()); @@ -404,7 +400,7 @@ public T getService(final Class serviceClass) { } Client client = WebClient.client(serviceInstance); - client.type(mediaType).accept(mediaType); + client.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON); if (serviceInstance instanceof AnyService || serviceInstance instanceof ExecutableService) { client.accept(RESTHeaders.MULTIPART_MIXED); } @@ -470,7 +466,6 @@ public Self self() { */ public BatchRequest batch() { return new BatchRequest( - mediaType, restClientFactory.getAddress(), restClientFactory.getProviders(), jwtInfo().map(JwtInfo::value).orElse(null), diff --git a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClientFactoryBean.java b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClientFactoryBean.java index 9556c060f47..a1b45d92d9e 100644 --- a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClientFactoryBean.java +++ b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClientFactoryBean.java @@ -19,9 +19,6 @@ package org.apache.syncope.client.lib; import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; -import com.fasterxml.jackson.jakarta.rs.xml.JacksonXMLProvider; -import com.fasterxml.jackson.jakarta.rs.yaml.JacksonYAMLProvider; -import jakarta.ws.rs.core.MediaType; import java.util.HashMap; import java.util.List; import java.util.Optional; @@ -32,8 +29,6 @@ import org.apache.cxf.transports.http.configuration.ConnectionType; import org.apache.cxf.transports.http.configuration.HTTPClientPolicy; import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper; -import org.apache.syncope.common.lib.jackson.SyncopeXmlMapper; -import org.apache.syncope.common.lib.jackson.SyncopeYAMLMapper; import org.apache.syncope.common.rest.api.DateParamConverterProvider; import org.apache.syncope.common.rest.api.RESTHeaders; @@ -43,43 +38,12 @@ */ public class SyncopeClientFactoryBean { - public enum ContentType { - - JSON(MediaType.APPLICATION_JSON_TYPE), - YAML(RESTHeaders.APPLICATION_YAML_TYPE), - XML(MediaType.APPLICATION_XML_TYPE); - - private final MediaType mediaType; - - ContentType(final MediaType mediaType) { - this.mediaType = mediaType; - } - - public MediaType getMediaType() { - return mediaType; - } - - public static ContentType fromString(final String value) { - return XML.getMediaType().toString().equalsIgnoreCase(value) - ? XML - : YAML.getMediaType().toString().equalsIgnoreCase(value) - ? YAML - : JSON; - } - } - private JacksonJsonProvider jsonProvider; - private JacksonXMLProvider xmlProvider; - - private JacksonYAMLProvider yamlProvider; - private RestClientExceptionMapper exceptionMapper; private String address; - private ContentType contentType; - private String domain; private boolean useCompression; @@ -94,14 +58,6 @@ protected static JacksonJsonProvider defaultJsonProvider() { return new JacksonJsonProvider(new SyncopeJsonMapper()); } - protected static JacksonXMLProvider defaultXmlProvider() { - return new JacksonXMLProvider(new SyncopeXmlMapper()); - } - - protected static JacksonYAMLProvider defaultYamlProvider() { - return new JacksonYAMLProvider(new SyncopeYAMLMapper()); - } - protected static RestClientExceptionMapper defaultExceptionMapper() { return new RestClientExceptionMapper(); } @@ -133,8 +89,6 @@ protected JAXRSClientFactoryBean defaultRestClientFactoryBean() { defaultRestClientFactoryBean.setProviders(List.of( new DateParamConverterProvider(), getJsonProvider(), - getXmlProvider(), - getYamlProvider(), getExceptionMapper())); return defaultRestClientFactoryBean; @@ -148,22 +102,6 @@ public void setJsonProvider(final JacksonJsonProvider jsonProvider) { this.jsonProvider = jsonProvider; } - public JacksonXMLProvider getXmlProvider() { - return Optional.ofNullable(xmlProvider).orElseGet(SyncopeClientFactoryBean::defaultXmlProvider); - } - - public void setXmlProvider(final JacksonXMLProvider xmlProvider) { - this.xmlProvider = xmlProvider; - } - - public JacksonYAMLProvider getYamlProvider() { - return Optional.ofNullable(yamlProvider).orElseGet(SyncopeClientFactoryBean::defaultYamlProvider); - } - - public void setYamlProvider(final JacksonYAMLProvider yamlProvider) { - this.yamlProvider = yamlProvider; - } - public RestClientExceptionMapper getExceptionMapper() { return Optional.ofNullable(exceptionMapper).orElseGet(SyncopeClientFactoryBean::defaultExceptionMapper); } @@ -182,20 +120,6 @@ public SyncopeClientFactoryBean setAddress(final String address) { return this; } - public ContentType getContentType() { - return Optional.ofNullable(contentType).orElse(ContentType.JSON); - } - - public SyncopeClientFactoryBean setContentType(final ContentType contentType) { - this.contentType = contentType; - return this; - } - - public SyncopeClientFactoryBean setContentType(final String contentType) { - this.contentType = ContentType.fromString(contentType); - return this; - } - public String getDomain() { return domain; } @@ -286,7 +210,6 @@ public SyncopeClient create(final String jwt) { */ public SyncopeClient create(final AuthenticationHandler handler) { return new SyncopeClient( - getContentType().getMediaType(), getRestClientFactoryBean(), getExceptionMapper(), handler, @@ -304,7 +227,6 @@ public SyncopeClient create(final AuthenticationHandler handler) { */ public SyncopeAnonymousClient createAnonymous(final String username, final String password) { return new SyncopeAnonymousClient( - getContentType().getMediaType(), getRestClientFactoryBean(), getExceptionMapper(), new AnonymousAuthenticationHandler(username, password), diff --git a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchRequest.java b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchRequest.java index a511108aef2..9f359d53eb0 100644 --- a/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchRequest.java +++ b/client/idrepo/lib/src/main/java/org/apache/syncope/client/lib/batch/BatchRequest.java @@ -41,8 +41,6 @@ public class BatchRequest { private static final Logger LOG = LoggerFactory.getLogger(BatchRequest.class); - private final MediaType mediaType; - private final String jwt; private final String address; @@ -54,13 +52,11 @@ public class BatchRequest { private BatchClientFactoryBean bcfb; public BatchRequest( - final MediaType mediaType, final String address, final List providers, final String jwt, final TLSClientParameters tlsClientParameters) { - this.mediaType = mediaType; this.jwt = jwt; this.address = address; this.providers = providers; @@ -79,7 +75,7 @@ public T getService(final Class serviceClass) { T serviceInstance = bcfb.create(serviceClass); Client client = WebClient.client(serviceInstance); - client.type(mediaType).accept(mediaType); + client.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON); return serviceInstance; } diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/LDAPAuthModuleConf.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/LDAPAuthModuleConf.java index 7221b17de23..2b427bf4749 100644 --- a/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/LDAPAuthModuleConf.java +++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/LDAPAuthModuleConf.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.auth; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -167,7 +165,7 @@ public enum DerefAliasesType { * */ private String credentialCriteria; - + public AuthenticationType getAuthenticationType() { return authenticationType; } @@ -224,8 +222,6 @@ public void setPrincipalDnAttributeName(final String principalDnAttributeName) { this.principalDnAttributeName = principalDnAttributeName; } - @JacksonXmlElementWrapper(localName = "additionalAttributes") - @JacksonXmlProperty(localName = "additionalAttribute") public List getAdditionalAttributes() { return additionalAttributes; } diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/AccessPolicyTO.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/AccessPolicyTO.java index 733b4e92a1d..1aa1ddf93a8 100644 --- a/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/AccessPolicyTO.java +++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/AccessPolicyTO.java @@ -20,7 +20,6 @@ package org.apache.syncope.common.lib.policy; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; @Schema(allOf = { PolicyTO.class }) @@ -30,7 +29,6 @@ public class AccessPolicyTO extends PolicyTO { private AccessPolicyConf conf; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.policy.AccessPolicyTO") diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/AttrReleasePolicyTO.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/AttrReleasePolicyTO.java index 35d3765f0ae..4e3e62f6e85 100644 --- a/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/AttrReleasePolicyTO.java +++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/AttrReleasePolicyTO.java @@ -19,7 +19,6 @@ package org.apache.syncope.common.lib.policy; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; @Schema(allOf = { PolicyTO.class }) @@ -33,7 +32,6 @@ public class AttrReleasePolicyTO extends PolicyTO { private AttrReleasePolicyConf conf; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.policy.AttrReleasePolicyTO") diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/AuthPolicyTO.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/AuthPolicyTO.java index 1753816fac1..7f34a896da3 100644 --- a/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/AuthPolicyTO.java +++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/AuthPolicyTO.java @@ -19,7 +19,6 @@ package org.apache.syncope.common.lib.policy; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; @Schema(allOf = { PolicyTO.class }) @@ -29,7 +28,6 @@ public class AuthPolicyTO extends PolicyTO { private AuthPolicyConf conf; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.policy.AuthPolicyTO") diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAttrReleasePolicyConf.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAttrReleasePolicyConf.java index 6bc299092f6..1130d0f1714 100644 --- a/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAttrReleasePolicyConf.java +++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAttrReleasePolicyConf.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.policy; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; @@ -100,8 +98,6 @@ public void setTimeUnit(final TimeUnit timeUnit) { this.timeUnit = timeUnit; } - @JacksonXmlElementWrapper(localName = "attrRepos") - @JacksonXmlProperty(localName = "attrRepo") public List getAttrRepos() { return attrRepos; } @@ -127,20 +123,14 @@ public Map getReleaseAttrs() { return releaseAttrs; } - @JacksonXmlElementWrapper(localName = "allowedAttrs") - @JacksonXmlProperty(localName = "allowedAttr") public List getAllowedAttrs() { return allowedAttrs; } - @JacksonXmlElementWrapper(localName = "excludedAttrs") - @JacksonXmlProperty(localName = "excludedAttr") public List getExcludedAttrs() { return excludedAttrs; } - @JacksonXmlElementWrapper(localName = "includeOnlyAttrs") - @JacksonXmlProperty(localName = "includeOnlyAttr") public List getIncludeOnlyAttrs() { return includeOnlyAttrs; } diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAuthPolicyConf.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAuthPolicyConf.java index 0398171f7d9..9bd722969d8 100644 --- a/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAuthPolicyConf.java +++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAuthPolicyConf.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.policy; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.List; @@ -32,7 +30,7 @@ public class DefaultAuthPolicyConf implements AuthPolicyConf { private boolean bypassEnabled; private boolean forceMfaExecution = true; - + private String bypassPrincipalAttributeName; private String bypassPrincipalAttributeValue; @@ -89,8 +87,6 @@ public void setBypassTrustedDeviceEnabled(final boolean bypassTrustedDeviceEnabl this.bypassTrustedDeviceEnabled = bypassTrustedDeviceEnabled; } - @JacksonXmlElementWrapper(localName = "authModules") - @JacksonXmlProperty(localName = "authModule") public List getAuthModules() { return authModules; } diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/RemoteEndpointAccessPolicyConf.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/RemoteEndpointAccessPolicyConf.java index c63959faef4..e6602df35ca 100644 --- a/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/RemoteEndpointAccessPolicyConf.java +++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/RemoteEndpointAccessPolicyConf.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.policy; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.List; @@ -39,8 +37,6 @@ public void setEndpointUrl(final String endpointUrl) { this.endpointUrl = endpointUrl; } - @JacksonXmlElementWrapper(localName = "acceptableResponseCodes") - @JacksonXmlProperty(localName = "acceptableResponseCode") public List getAcceptableResponseCodes() { return acceptableResponseCodes; } diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/TicketExpirationPolicyTO.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/TicketExpirationPolicyTO.java index 04f48c1db57..88fc8316e81 100644 --- a/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/TicketExpirationPolicyTO.java +++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/policy/TicketExpirationPolicyTO.java @@ -20,7 +20,6 @@ package org.apache.syncope.common.lib.policy; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; @Schema(allOf = { PolicyTO.class }) @@ -30,7 +29,6 @@ public class TicketExpirationPolicyTO extends PolicyTO { private TicketExpirationPolicyConf conf; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.policy.TicketExpirationPolicyTO") diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/AuthProfileTO.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/AuthProfileTO.java index c87f13545ad..92c06999a46 100644 --- a/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/AuthProfileTO.java +++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/AuthProfileTO.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import jakarta.ws.rs.PathParam; import java.util.ArrayList; import java.util.Collection; @@ -148,32 +146,22 @@ public void setOwner(final String owner) { this.owner = owner; } - @JacksonXmlElementWrapper(localName = "impersonationAccounts") - @JacksonXmlProperty(localName = "impersonationAccount") public List getImpersonationAccounts() { return impersonationAccounts; } - @JacksonXmlElementWrapper(localName = "googleMfaAuthTokens") - @JacksonXmlProperty(localName = "googleMfaAuthToken") public List getGoogleMfaAuthTokens() { return googleMfaAuthTokens; } - @JacksonXmlElementWrapper(localName = "googleMfaAuthAccounts") - @JacksonXmlProperty(localName = "googleMfaAuthAccount") public List getGoogleMfaAuthAccounts() { return googleMfaAuthAccounts; } - @JacksonXmlElementWrapper(localName = "mfaTrustedDevices") - @JacksonXmlProperty(localName = "mfaTrustedDevice") public List getMfaTrustedDevices() { return mfaTrustedDevices; } - @JacksonXmlElementWrapper(localName = "credentials") - @JacksonXmlProperty(localName = "credential") public List getWebAuthnDeviceCredentials() { return webAuthnDeviceCredentials; } diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/CASSPClientAppTO.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/CASSPClientAppTO.java index 60589f4e41d..81bed3eec1c 100644 --- a/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/CASSPClientAppTO.java +++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/CASSPClientAppTO.java @@ -19,7 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -39,7 +38,6 @@ public void setServiceId(final String serviceId) { this.serviceId = serviceId; } - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.to.client.CASSPTO") diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/ClientAppTO.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/ClientAppTO.java index 5d2e31e439f..770202eee43 100644 --- a/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/ClientAppTO.java +++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/ClientAppTO.java @@ -21,8 +21,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.ws.rs.PathParam; import java.util.ArrayList; @@ -41,7 +39,6 @@ public abstract class ClientAppTO implements NamedEntityTO { private static final long serialVersionUID = 6577639976115661357L; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") private String discriminator; @@ -211,8 +208,6 @@ public void setTicketExpirationPolicy(final String ticketExpirationPolicy) { this.ticketExpirationPolicy = ticketExpirationPolicy; } - @JacksonXmlElementWrapper(localName = "properties") - @JacksonXmlProperty(localName = "property") public List getProperties() { return properties; } diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/OIDCRPClientAppTO.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/OIDCRPClientAppTO.java index eb77daedd7f..18e56479b9d 100644 --- a/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/OIDCRPClientAppTO.java +++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/OIDCRPClientAppTO.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.List; @@ -89,7 +87,6 @@ public class OIDCRPClientAppTO extends ClientAppTO { private String logoutUri; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.to.client.OIDCRPTO") @@ -114,20 +111,14 @@ public void setClientSecret(final String clientSecret) { this.clientSecret = clientSecret; } - @JacksonXmlElementWrapper(localName = "redirectUris") - @JacksonXmlProperty(localName = "redirectUri") public List getRedirectUris() { return redirectUris; } - @JacksonXmlElementWrapper(localName = "supportedGrantTypes") - @JacksonXmlProperty(localName = "supportedGrantType") public List getSupportedGrantTypes() { return supportedGrantTypes; } - @JacksonXmlElementWrapper(localName = "supportedResponseTypes") - @JacksonXmlProperty(localName = "supportedResponseType") public List getSupportedResponseTypes() { return supportedResponseTypes; } @@ -228,8 +219,6 @@ public void setJwtAccessToken(final boolean jwtAccessToken) { this.jwtAccessToken = jwtAccessToken; } - @JacksonXmlElementWrapper(localName = "scopes") - @JacksonXmlProperty(localName = "scope") public List getScopes() { return scopes; } diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/SAML2SPClientAppTO.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/SAML2SPClientAppTO.java index 46ad7f5384f..39c6b1d89f6 100644 --- a/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/SAML2SPClientAppTO.java +++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/to/SAML2SPClientAppTO.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.List; @@ -74,7 +72,6 @@ public class SAML2SPClientAppTO extends ClientAppTO { private final List encryptionBlackListedAlgorithms = new ArrayList<>(); - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.to.client.SAML2SPTO") @@ -179,8 +176,6 @@ public void setNameIdQualifier(final String nameIdQualifier) { this.nameIdQualifier = nameIdQualifier; } - @JacksonXmlElementWrapper(localName = "assertionAudiences") - @JacksonXmlProperty(localName = "assertionAudience") public List getAssertionAudiences() { return assertionAudiences; } @@ -193,38 +188,26 @@ public void setServiceProviderNameIdQualifier(final String serviceProviderNameId this.serviceProviderNameIdQualifier = serviceProviderNameIdQualifier; } - @JacksonXmlElementWrapper(localName = "signingSignatureAlgorithms") - @JacksonXmlProperty(localName = "signingSignatureAlgorithm") public List getSigningSignatureAlgorithms() { return signingSignatureAlgorithms; } - @JacksonXmlElementWrapper(localName = "signingSignatureReferenceDigestMethods") - @JacksonXmlProperty(localName = "signingSignatureReferenceDigestMethod") public List getSigningSignatureReferenceDigestMethods() { return signingSignatureReferenceDigestMethods; } - @JacksonXmlElementWrapper(localName = "encryptionDataAlgorithms") - @JacksonXmlProperty(localName = "encryptionDataAlgorithm") public List getEncryptionDataAlgorithms() { return encryptionDataAlgorithms; } - @JacksonXmlElementWrapper(localName = "encryptionKeyAlgorithms") - @JacksonXmlProperty(localName = "encryptionKeyAlgorithm") public List getEncryptionKeyAlgorithms() { return encryptionKeyAlgorithms; } - @JacksonXmlElementWrapper(localName = "signingSignatureBlackListedAlgorithms") - @JacksonXmlProperty(localName = "signingSignatureBlackListedAlgorithm") public List getSigningSignatureBlackListedAlgorithms() { return signingSignatureBlackListedAlgorithms; } - @JacksonXmlElementWrapper(localName = "encryptionBlackListedAlgorithms") - @JacksonXmlProperty(localName = "encryptionBlackListedAlgorithm") public List getEncryptionBlackListedAlgorithms() { return encryptionBlackListedAlgorithms; } diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/wa/WAClientApp.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/wa/WAClientApp.java index 5780d8c8235..e9f9ad03d6e 100644 --- a/common/am/lib/src/main/java/org/apache/syncope/common/lib/wa/WAClientApp.java +++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/wa/WAClientApp.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.wa; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.List; import org.apache.syncope.common.lib.BaseBean; @@ -62,8 +60,6 @@ public void setAccessPolicy(final AccessPolicyTO accessPolicy) { this.accessPolicy = accessPolicy; } - @JacksonXmlElementWrapper(localName = "authModules") - @JacksonXmlProperty(localName = "authModule") public List getAuthModules() { return authModules; } diff --git a/common/am/lib/src/main/java/org/apache/syncope/common/lib/wa/WebAuthnAccount.java b/common/am/lib/src/main/java/org/apache/syncope/common/lib/wa/WebAuthnAccount.java index 3c22a9c6df8..671d72dbf28 100644 --- a/common/am/lib/src/main/java/org/apache/syncope/common/lib/wa/WebAuthnAccount.java +++ b/common/am/lib/src/main/java/org/apache/syncope/common/lib/wa/WebAuthnAccount.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.wa; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -58,8 +56,6 @@ public WebAuthnAccount build() { private final List credentials = new ArrayList<>(); - @JacksonXmlElementWrapper(localName = "credentials") - @JacksonXmlProperty(localName = "credential") public List getCredentials() { return credentials; } diff --git a/common/am/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java b/common/am/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java deleted file mode 100644 index adb47a8f5d9..00000000000 --- a/common/am/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.common.lib; - -import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper; - -public class JSONTest extends SerializationTest { - - private static final ObjectMapper OBJECT_MAPPER = new SyncopeJsonMapper(); - - @Override - protected ObjectMapper objectMapper() { - return OBJECT_MAPPER; - } -} diff --git a/common/am/lib/src/test/java/org/apache/syncope/common/lib/SerializationTest.java b/common/am/lib/src/test/java/org/apache/syncope/common/lib/SerializationTest.java index 60627a628a1..b6df7e58494 100644 --- a/common/am/lib/src/test/java/org/apache/syncope/common/lib/SerializationTest.java +++ b/common/am/lib/src/test/java/org/apache/syncope/common/lib/SerializationTest.java @@ -20,17 +20,18 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.json.JsonMapper; import java.io.IOException; import java.io.StringWriter; import java.net.URI; +import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper; import org.apache.syncope.common.lib.policy.AccessPolicyTO; import org.apache.syncope.common.lib.policy.DefaultAccessPolicyConf; import org.junit.jupiter.api.Test; -public abstract class SerializationTest { +public class SerializationTest { - protected abstract ObjectMapper objectMapper(); + private static final JsonMapper MAPPER = new SyncopeJsonMapper(); @Test public void accessPolicyConf() throws IOException { @@ -46,9 +47,9 @@ public void accessPolicyConf() throws IOException { policy.setConf(conf); StringWriter writer = new StringWriter(); - objectMapper().writeValue(writer, policy); + MAPPER.writeValue(writer, policy); - AccessPolicyTO actual = objectMapper().readValue(writer.toString(), AccessPolicyTO.class); + AccessPolicyTO actual = MAPPER.readValue(writer.toString(), AccessPolicyTO.class); assertEquals(policy, actual); } } diff --git a/common/am/lib/src/test/java/org/apache/syncope/common/lib/XMLTest.java b/common/am/lib/src/test/java/org/apache/syncope/common/lib/XMLTest.java deleted file mode 100644 index b835f5ed08c..00000000000 --- a/common/am/lib/src/test/java/org/apache/syncope/common/lib/XMLTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.common.lib; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.xml.XmlMapper; -import org.apache.syncope.common.lib.jackson.SyncopeXmlMapper; - -public class XMLTest extends SerializationTest { - - private static final XmlMapper XML_MAPPER = new SyncopeXmlMapper(); - - @Override - protected ObjectMapper objectMapper() { - return XML_MAPPER; - } -} diff --git a/common/am/lib/src/test/java/org/apache/syncope/common/lib/YAMLTest.java b/common/am/lib/src/test/java/org/apache/syncope/common/lib/YAMLTest.java deleted file mode 100644 index 093322a7417..00000000000 --- a/common/am/lib/src/test/java/org/apache/syncope/common/lib/YAMLTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.common.lib; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; -import org.apache.syncope.common.lib.jackson.SyncopeYAMLMapper; - -public class YAMLTest extends SerializationTest { - - private static final YAMLMapper YAML_MAPPER = new SyncopeYAMLMapper(); - - @Override - protected ObjectMapper objectMapper() { - return YAML_MAPPER; - } -} diff --git a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AttrRepoService.java b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AttrRepoService.java index eb4063def89..feac7bf5f66 100644 --- a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AttrRepoService.java +++ b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AttrRepoService.java @@ -61,7 +61,7 @@ public interface AttrRepoService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) AttrRepoTO read(@NotNull @PathParam("key") String key); /** @@ -70,7 +70,7 @@ public interface AttrRepoService extends JAXRSService { * @return list of attribute repositories */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -89,8 +89,8 @@ public interface AttrRepoService extends JAXRSService { @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull AttrRepoTO attrRepoTO); /** @@ -104,8 +104,8 @@ public interface AttrRepoService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull AttrRepoTO attrRepoTO); /** @@ -117,6 +117,6 @@ public interface AttrRepoService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); } diff --git a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AuthModuleService.java b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AuthModuleService.java index ee6a2e89076..36110435c26 100644 --- a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AuthModuleService.java +++ b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AuthModuleService.java @@ -61,7 +61,7 @@ public interface AuthModuleService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) AuthModuleTO read(@NotNull @PathParam("key") String key); /** @@ -70,7 +70,7 @@ public interface AuthModuleService extends JAXRSService { * @return list of authentication modules */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -89,8 +89,8 @@ public interface AuthModuleService extends JAXRSService { @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull AuthModuleTO authModuleTO); /** @@ -104,8 +104,8 @@ public interface AuthModuleService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull AuthModuleTO authModuleTO); /** @@ -117,6 +117,6 @@ public interface AuthModuleService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); } diff --git a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AuthProfileSelfService.java b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AuthProfileSelfService.java index 12315eac3b0..052877c41f1 100644 --- a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AuthProfileSelfService.java +++ b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AuthProfileSelfService.java @@ -30,7 +30,6 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; import org.apache.syncope.common.lib.to.AuthProfileTO; -import org.apache.syncope.common.rest.api.RESTHeaders; /** * REST operations for Auth profile self-management. @@ -48,8 +47,8 @@ public interface AuthProfileSelfService extends JAXRSService { * @return auth profile matching the user making the service call, if found */ @GET - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) AuthProfileTO read(); /** @@ -58,15 +57,15 @@ public interface AuthProfileSelfService extends JAXRSService { * @param authProfileTO auth profile */ @PUT - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull AuthProfileTO authProfileTO); /** * Deletes the auth profile matching the user making the service call, if found. */ @DELETE - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(); } diff --git a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AuthProfileService.java b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AuthProfileService.java index d0e5dc4eac0..81ba99188c3 100644 --- a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AuthProfileService.java +++ b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AuthProfileService.java @@ -64,7 +64,7 @@ public interface AuthProfileService extends JAXRSService { * @return the paginated list of existing auth profiles */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) PagedResult list( @Min(1) @QueryParam(PARAM_PAGE) @DefaultValue("1") int page, @Min(1) @QueryParam(PARAM_SIZE) @DefaultValue("25") int size); @@ -77,8 +77,8 @@ PagedResult list( */ @GET @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) AuthProfileTO read(@NotNull @PathParam("key") String key); /** @@ -97,8 +97,8 @@ PagedResult list( @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull AuthProfileTO authProfileTO); /** @@ -110,8 +110,8 @@ PagedResult list( @Schema(type = "string")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull AuthProfileTO authProfileTO); /** @@ -121,7 +121,7 @@ PagedResult list( */ @DELETE @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); } diff --git a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ClientAppService.java b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ClientAppService.java index ea062d56fa1..05bdbd5be42 100644 --- a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ClientAppService.java +++ b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ClientAppService.java @@ -64,7 +64,7 @@ public interface ClientAppService extends JAXRSService { */ @GET @Path("{type}/{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) T read( @NotNull @PathParam("type") ClientAppType type, @NotNull @PathParam("key") String key); @@ -78,7 +78,7 @@ T read( */ @GET @Path("{type}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(@NotNull @PathParam("type") ClientAppType type); /** @@ -99,8 +99,8 @@ T read( description = "URL of the entity created") })) @POST @Path("{type}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull @PathParam("type") ClientAppType type, @NotNull ClientAppTO clientAppTO); /** @@ -115,8 +115,8 @@ T read( @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{type}/{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull @PathParam("type") ClientAppType type, @NotNull ClientAppTO clientAppTO); /** @@ -129,6 +129,6 @@ T read( @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{type}/{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("type") ClientAppType type, @NotNull @PathParam("key") String key); } diff --git a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCJWKSService.java b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCJWKSService.java index 76afce55e5f..d150591d26f 100644 --- a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCJWKSService.java +++ b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCJWKSService.java @@ -38,7 +38,6 @@ import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; import org.apache.syncope.common.lib.to.OIDCJWKSTO; -import org.apache.syncope.common.rest.api.RESTHeaders; @Tag(name = "OpenID Connect 1.0") @SecurityRequirements({ @@ -48,14 +47,14 @@ public interface OIDCJWKSService extends JAXRSService { @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) OIDCJWKSTO get(); @ApiResponses( @ApiResponse(responseCode = "204", description = "Operation was successful")) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void set(@NotNull OIDCJWKSTO entityTO); @ApiResponses({ @@ -67,8 +66,8 @@ public interface OIDCJWKSService extends JAXRSService { @ApiResponse(responseCode = "409", description = "JWKS already exists") }) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) @Path("new") Response generate( @NotNull @QueryParam("jwksKeyId") @DefaultValue("syncope") String jwksKeyId, @@ -76,7 +75,7 @@ Response generate( @NotNull @QueryParam("jwksKeySize") @DefaultValue("2048") int jwksKeySize); @DELETE - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(); } diff --git a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PasswordManagementService.java b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PasswordManagementService.java index 36e3166ea22..7196b03dfa0 100644 --- a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PasswordManagementService.java +++ b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PasswordManagementService.java @@ -61,7 +61,7 @@ public interface PasswordManagementService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) PasswordManagementTO read(@NotNull @PathParam("key") String key); /** @@ -70,7 +70,7 @@ public interface PasswordManagementService extends JAXRSService { * @return list of password management modules */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -89,8 +89,8 @@ public interface PasswordManagementService extends JAXRSService { @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull PasswordManagementTO passwordManagementTO); /** @@ -104,8 +104,8 @@ public interface PasswordManagementService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull PasswordManagementTO passwordManagementTO); /** @@ -117,6 +117,6 @@ public interface PasswordManagementService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); } diff --git a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPEntityService.java b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPEntityService.java index c13b48b9995..761936f773e 100644 --- a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPEntityService.java +++ b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2IdPEntityService.java @@ -35,7 +35,6 @@ import jakarta.ws.rs.core.MediaType; import java.util.List; import org.apache.syncope.common.lib.to.SAML2IdPEntityTO; -import org.apache.syncope.common.rest.api.RESTHeaders; /** * REST operations for SAML 2.0 IdP metadata. @@ -55,7 +54,7 @@ public interface SAML2IdPEntityService extends JAXRSService { * @return SAML 2.0 IdP entities */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -66,7 +65,7 @@ public interface SAML2IdPEntityService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) SAML2IdPEntityTO get(@NotNull @PathParam("key") String key); /** @@ -78,8 +77,8 @@ public interface SAML2IdPEntityService extends JAXRSService { @Schema(type = "string")) @POST @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void set(@NotNull SAML2IdPEntityTO entityTO); /** @@ -91,6 +90,6 @@ public interface SAML2IdPEntityService extends JAXRSService { @Schema(type = "string")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); } diff --git a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SRARouteService.java b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SRARouteService.java index 3c649a3cc91..4c1ad3f3773 100644 --- a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SRARouteService.java +++ b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SRARouteService.java @@ -59,7 +59,7 @@ public interface SRARouteService extends JAXRSService { * @return paged list of existing routes matching the given query */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -78,8 +78,8 @@ public interface SRARouteService extends JAXRSService { @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull SRARouteTO routeTO); /** @@ -90,7 +90,7 @@ public interface SRARouteService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) SRARouteTO read(@NotNull @PathParam("key") String key); /** @@ -104,8 +104,8 @@ public interface SRARouteService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull SRARouteTO routeTO); /** @@ -117,7 +117,7 @@ public interface SRARouteService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); /** @@ -127,6 +127,6 @@ public interface SRARouteService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @POST @Path("push") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void pushToSRA(); } diff --git a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/GoogleMfaAuthAccountService.java b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/GoogleMfaAuthAccountService.java index 8b3b751950a..c316f8c857d 100644 --- a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/GoogleMfaAuthAccountService.java +++ b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/GoogleMfaAuthAccountService.java @@ -33,7 +33,6 @@ import jakarta.ws.rs.core.MediaType; import org.apache.syncope.common.lib.to.PagedResult; import org.apache.syncope.common.lib.wa.GoogleMfaAuthAccount; -import org.apache.syncope.common.rest.api.RESTHeaders; import org.apache.syncope.common.rest.api.service.JAXRSService; @Tag(name = "WA") @@ -44,46 +43,46 @@ public interface GoogleMfaAuthAccountService extends JAXRSService { @GET - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) PagedResult list(); @GET - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) @Path("{owner}") PagedResult read(@NotNull @PathParam("owner") String owner); @GET @Path("devices/{id}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) GoogleMfaAuthAccount read(@NotNull @PathParam("id") long id); @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void create(@NotNull GoogleMfaAuthAccount acct); @PUT - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull GoogleMfaAuthAccount acct); @DELETE - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) @Path("{owner}") void delete(@NotNull @PathParam("owner") String owner); @DELETE - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) @Path("devices/{id}") void delete(@NotNull @PathParam("id") long id); @DELETE - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void deleteAll(); } diff --git a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/GoogleMfaAuthTokenService.java b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/GoogleMfaAuthTokenService.java index f7cc23f9de7..e47c2ce79bd 100644 --- a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/GoogleMfaAuthTokenService.java +++ b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/GoogleMfaAuthTokenService.java @@ -34,7 +34,6 @@ import java.time.LocalDateTime; import org.apache.syncope.common.lib.to.PagedResult; import org.apache.syncope.common.lib.wa.GoogleMfaAuthToken; -import org.apache.syncope.common.rest.api.RESTHeaders; import org.apache.syncope.common.rest.api.service.JAXRSService; @Tag(name = "WA") @@ -45,48 +44,48 @@ public interface GoogleMfaAuthTokenService extends JAXRSService { @DELETE - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@QueryParam("expirationDate") LocalDateTime expirationDate); @DELETE @Path("{owner}/{otp}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("owner") String owner, @NotNull @PathParam("otp") int otp); @DELETE @Path("{owner}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("owner") String owner); @DELETE @Path("otp/{otp}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("otp") int otp); @PUT @Path("{owner}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void store(@NotNull @PathParam("owner") String owner, @NotNull GoogleMfaAuthToken token); @GET - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) @Path("{owner}/{otp}") GoogleMfaAuthToken read(@NotNull @PathParam("owner") String owner, @NotNull @PathParam("otp") int otp); @GET - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) @Path("{owner}") PagedResult read(@NotNull @PathParam("owner") String owner); @GET - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) PagedResult list(); } diff --git a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/ImpersonationService.java b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/ImpersonationService.java index b80d9a14a58..7d31277c01f 100644 --- a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/ImpersonationService.java +++ b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/ImpersonationService.java @@ -32,7 +32,6 @@ import jakarta.ws.rs.core.MediaType; import java.util.List; import org.apache.syncope.common.lib.wa.ImpersonationAccount; -import org.apache.syncope.common.rest.api.RESTHeaders; import org.apache.syncope.common.rest.api.service.JAXRSService; @Tag(name = "WA") @@ -44,19 +43,19 @@ public interface ImpersonationService extends JAXRSService { @GET @Path("{owner}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) List read(@NotNull @PathParam("owner") String owner); @POST @Path("{owner}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void create(@NotNull @PathParam("owner") String owner, @NotNull ImpersonationAccount account); @DELETE @Path("{owner}/{impersonated}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("owner") String owner, @NotNull @PathParam("impersonated") String impersonated); } diff --git a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/MfaTrustStorageService.java b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/MfaTrustStorageService.java index 1c7c362d0a9..bf2e6abd2c8 100644 --- a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/MfaTrustStorageService.java +++ b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/MfaTrustStorageService.java @@ -33,7 +33,6 @@ import jakarta.ws.rs.core.MediaType; import org.apache.syncope.common.lib.to.PagedResult; import org.apache.syncope.common.lib.wa.MfaTrustedDevice; -import org.apache.syncope.common.rest.api.RESTHeaders; import org.apache.syncope.common.rest.api.beans.MfaTrustedDeviceQuery; import org.apache.syncope.common.rest.api.service.JAXRSService; @@ -45,18 +44,18 @@ public interface MfaTrustStorageService extends JAXRSService { @GET - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) PagedResult search(@BeanParam MfaTrustedDeviceQuery query); @POST @Path("{principal}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void create(@NotNull @PathParam("principal") String principal, @NotNull MfaTrustedDevice device); @DELETE - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@BeanParam MfaTrustedDeviceQuery query); } diff --git a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/WAConfigService.java b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/WAConfigService.java index 40e55d05b1e..10842312c41 100644 --- a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/WAConfigService.java +++ b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/WAConfigService.java @@ -39,7 +39,6 @@ import jakarta.ws.rs.core.MediaType; import java.util.List; import org.apache.syncope.common.lib.Attr; -import org.apache.syncope.common.rest.api.RESTHeaders; import org.apache.syncope.common.rest.api.service.JAXRSService; /** @@ -59,8 +58,8 @@ enum PushSubject { } @GET - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -71,8 +70,8 @@ enum PushSubject { */ @GET @Path("{schema}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Attr get(@NotNull @PathParam("schema") String schema); /** @@ -85,8 +84,8 @@ enum PushSubject { @ApiResponses( @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) @Path("{schema}") void set(@NotNull Attr value); @@ -99,7 +98,7 @@ enum PushSubject { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{schema}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("schema") String schema); /** @@ -112,6 +111,6 @@ enum PushSubject { @ApiResponse(responseCode = "204", description = "Operation was successful")) @POST @Path("push/{subject}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void pushToWA(@NotNull @PathParam("subject") PushSubject subject, @QueryParam("service") List services); } diff --git a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/WebAuthnRegistrationService.java b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/WebAuthnRegistrationService.java index f8eff6a2e3f..acbd2904067 100644 --- a/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/WebAuthnRegistrationService.java +++ b/common/am/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/wa/WebAuthnRegistrationService.java @@ -33,7 +33,6 @@ import jakarta.ws.rs.core.MediaType; import java.util.List; import org.apache.syncope.common.lib.wa.WebAuthnAccount; -import org.apache.syncope.common.rest.api.RESTHeaders; import org.apache.syncope.common.rest.api.service.JAXRSService; @Tag(name = "WA") @@ -44,37 +43,37 @@ public interface WebAuthnRegistrationService extends JAXRSService { @GET - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); @GET - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) @Path("{owner}") WebAuthnAccount read(@NotNull @PathParam("owner") String owner); @DELETE - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) @Path("{owner}") void delete(@NotNull @PathParam("owner") String owner); @DELETE - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) @Path("{owner}/{credentialId}") void delete(@NotNull @PathParam("owner") String owner, @NotNull @PathParam("credentialId") String credentialId); @POST @Path("{owner}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void create(@NotNull @PathParam("owner") String owner, @NotNull WebAuthnAccount account); @PUT @Path("{owner}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull @PathParam("owner") String owner, @NotNull WebAuthnAccount account); } diff --git a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultInboundCorrelationRuleConf.java b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultInboundCorrelationRuleConf.java index 5e5ac4bb974..f241517f12e 100644 --- a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultInboundCorrelationRuleConf.java +++ b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultInboundCorrelationRuleConf.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.policy; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.List; @@ -40,8 +38,6 @@ public void setOrSchemas(final boolean orSchemas) { this.orSchemas = orSchemas; } - @JacksonXmlElementWrapper(localName = "schemas") - @JacksonXmlProperty(localName = "schema") public List getSchemas() { return schemas; } diff --git a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultPushCorrelationRuleConf.java b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultPushCorrelationRuleConf.java index b8a7974a202..5efaabf7437 100644 --- a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultPushCorrelationRuleConf.java +++ b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultPushCorrelationRuleConf.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.policy; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.List; @@ -39,8 +37,6 @@ public void setOrSchemas(final boolean orSchemas) { this.orSchemas = orSchemas; } - @JacksonXmlElementWrapper(localName = "schemas") - @JacksonXmlProperty(localName = "schema") public List getSchemas() { return schemas; } diff --git a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/InboundPolicyTO.java b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/InboundPolicyTO.java index 8e454f44cb1..eed4da06885 100644 --- a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/InboundPolicyTO.java +++ b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/InboundPolicyTO.java @@ -19,7 +19,6 @@ package org.apache.syncope.common.lib.policy; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; @Schema(allOf = { ProvisioningPolicyTO.class }) @@ -27,7 +26,6 @@ public class InboundPolicyTO extends ProvisioningPolicyTO { private static final long serialVersionUID = 993024634238024242L; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.policy.InboundPolicyTO") diff --git a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/PropagationPolicyTO.java b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/PropagationPolicyTO.java index 4a598c628be..03b12f8529e 100644 --- a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/PropagationPolicyTO.java +++ b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/PropagationPolicyTO.java @@ -19,7 +19,6 @@ package org.apache.syncope.common.lib.policy; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import org.apache.syncope.common.lib.types.BackOffStrategy; @@ -38,7 +37,6 @@ public class PropagationPolicyTO extends PolicyTO { private int maxAttempts = 3; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.policy.PropagationPolicyTO") diff --git a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/ProvisioningPolicyTO.java b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/ProvisioningPolicyTO.java index b3a5a15f352..52a078a9e10 100644 --- a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/ProvisioningPolicyTO.java +++ b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/ProvisioningPolicyTO.java @@ -19,7 +19,6 @@ package org.apache.syncope.common.lib.policy; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.HashMap; import java.util.Map; @@ -37,7 +36,6 @@ public abstract class ProvisioningPolicyTO extends PolicyTO { private final Map correlationRules = new HashMap<>(); - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.policy.ProvisioningPolicyTO") diff --git a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/PushPolicyTO.java b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/PushPolicyTO.java index fc52b71b0b6..c526e9ee71f 100644 --- a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/PushPolicyTO.java +++ b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/policy/PushPolicyTO.java @@ -19,7 +19,6 @@ package org.apache.syncope.common.lib.policy; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; @Schema(allOf = { ProvisioningPolicyTO.class }) @@ -27,7 +26,6 @@ public class PushPolicyTO extends ProvisioningPolicyTO { private static final long serialVersionUID = 993024634238024242L; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.policy.PushPolicyTO") diff --git a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdBundle.java b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdBundle.java index 1256ef824c9..91433f50fd9 100644 --- a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdBundle.java +++ b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdBundle.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.List; import org.apache.syncope.common.lib.BaseBean; @@ -73,8 +71,6 @@ public void setConnectorName(final String connectorName) { this.connectorName = connectorName; } - @JacksonXmlElementWrapper(localName = "properties") - @JacksonXmlProperty(localName = "connConfPropSchema") public List getProperties() { return properties; } diff --git a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdObjectClass.java b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdObjectClass.java index fe5695cb903..e3197f96a0e 100644 --- a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdObjectClass.java +++ b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/ConnIdObjectClass.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.List; import org.apache.syncope.common.lib.BaseBean; @@ -63,8 +61,6 @@ public void setAuxiliary(final boolean auxiliary) { this.auxiliary = auxiliary; } - @JacksonXmlElementWrapper(localName = "attributes") - @JacksonXmlProperty(localName = "attribute") public List getAttributes() { return attributes; } diff --git a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/ConnInstanceTO.java b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/ConnInstanceTO.java index 57451afad66..d1519adc964 100644 --- a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/ConnInstanceTO.java +++ b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/ConnInstanceTO.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.ws.rs.PathParam; import java.util.ArrayList; @@ -122,8 +120,6 @@ public void setVersion(final String version) { this.version = version; } - @JacksonXmlElementWrapper(localName = "conf") - @JacksonXmlProperty(localName = "property") public List getConf() { return this.conf; } @@ -133,8 +129,6 @@ public Optional getConf(final String schemaName) { return conf.stream().filter(property -> property.getSchema().getName().equals(schemaName)).findFirst(); } - @JacksonXmlElementWrapper(localName = "capabilities") - @JacksonXmlProperty(localName = "capability") public Set getCapabilities() { return capabilities; } diff --git a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/PagedConnObjectResult.java b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/PagedConnObjectResult.java index 8b61a8d508d..6aee57538f3 100644 --- a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/PagedConnObjectResult.java +++ b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/PagedConnObjectResult.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.net.URI; import java.util.ArrayList; import java.util.List; @@ -107,8 +105,6 @@ public void setAllResultsReturned(final boolean allResultsReturned) { this.allResultsReturned = allResultsReturned; } - @JacksonXmlElementWrapper(localName = "result") - @JacksonXmlProperty(localName = "item") public List getResult() { return result; } diff --git a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/Provision.java b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/Provision.java index 702bba65bca..65a5768a04f 100644 --- a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/Provision.java +++ b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/to/Provision.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -60,8 +58,6 @@ public void setObjectClass(final String objectClass) { this.objectClass = objectClass; } - @JacksonXmlElementWrapper(localName = "auxClasses") - @JacksonXmlProperty(localName = "class") public List getAuxClasses() { return auxClasses; } diff --git a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/types/ConnConfPropSchema.java b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/types/ConnConfPropSchema.java index e2c7a2ed69f..472ec158097 100644 --- a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/types/ConnConfPropSchema.java +++ b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/types/ConnConfPropSchema.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.types; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.builder.EqualsBuilder; @@ -102,8 +100,6 @@ public void setConfidential(final boolean confidential) { this.confidential = confidential; } - @JacksonXmlElementWrapper(localName = "defaultValues") - @JacksonXmlProperty(localName = "defaultValue") public List getDefaultValues() { return defaultValues; } diff --git a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/types/ConnConfProperty.java b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/types/ConnConfProperty.java index 0a6b176581d..77744c83044 100644 --- a/common/idm/lib/src/main/java/org/apache/syncope/common/lib/types/ConnConfProperty.java +++ b/common/idm/lib/src/main/java/org/apache/syncope/common/lib/types/ConnConfProperty.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.types; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.builder.EqualsBuilder; @@ -44,8 +42,6 @@ public void setSchema(final ConnConfPropSchema schema) { this.schema = schema; } - @JacksonXmlElementWrapper(localName = "values") - @JacksonXmlProperty(localName = "value") public List getValues() { return values; } diff --git a/common/idm/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java b/common/idm/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java index 302dee715c1..fbdf5cb1d2e 100644 --- a/common/idm/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java +++ b/common/idm/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ConnectorService.java @@ -65,7 +65,7 @@ public interface ConnectorService extends JAXRSService { */ @GET @Path("bundles") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List getBundles(@QueryParam("lang") String lang); /** @@ -82,8 +82,8 @@ public interface ConnectorService extends JAXRSService { @Schema(type = "string")) @POST @Path("{key}/supportedObjectClasses") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) List buildObjectClassInfo( @NotNull ConnInstanceTO connInstanceTO, @QueryParam("includeSpecial") @DefaultValue("false") boolean includeSpecial); @@ -98,7 +98,7 @@ List buildObjectClassInfo( */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) ConnInstanceTO read(@NotNull @PathParam("key") String key, @QueryParam("lang") String lang); /** @@ -111,7 +111,7 @@ List buildObjectClassInfo( */ @GET @Path("byResource/{resourceName}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) ConnInstanceTO readByResource( @NotNull @PathParam("resourceName") String resourceName, @QueryParam("lang") String lang); @@ -123,7 +123,7 @@ ConnInstanceTO readByResource( * @return list of all connector instances with property keys in the matching language */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(@QueryParam("lang") String lang); /** @@ -142,8 +142,8 @@ ConnInstanceTO readByResource( @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull ConnInstanceTO connInstanceTO); /** @@ -157,8 +157,8 @@ ConnInstanceTO readByResource( @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull ConnInstanceTO connInstanceTO); /** @@ -170,7 +170,7 @@ ConnInstanceTO readByResource( @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); /** @@ -182,8 +182,8 @@ ConnInstanceTO readByResource( @ApiResponse(responseCode = "204", description = "Operation was successful")) @POST @Path("check") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void check(@NotNull ConnInstanceTO connInstanceTO); /** @@ -193,6 +193,6 @@ ConnInstanceTO readByResource( @ApiResponse(responseCode = "204", description = "Operation was successful")) @POST @Path("reload") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void reload(); } diff --git a/common/idm/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReconciliationService.java b/common/idm/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReconciliationService.java index b80fe5d47b9..d6d5a95e2db 100644 --- a/common/idm/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReconciliationService.java +++ b/common/idm/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReconciliationService.java @@ -61,7 +61,7 @@ public interface ReconciliationService extends JAXRSService { * @return reconciliation status */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) ReconStatus status(@BeanParam ReconQuery query); /** @@ -75,8 +75,8 @@ public interface ReconciliationService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @POST @Path("push") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) List push(@BeanParam ReconQuery query, @NotNull PushTaskTO pushTask); /** @@ -90,8 +90,8 @@ public interface ReconciliationService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @POST @Path("pull") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) List pull(@BeanParam ReconQuery query, @NotNull PullTaskTO pullTask); /** @@ -103,7 +103,7 @@ public interface ReconciliationService extends JAXRSService { */ @GET @Path("csv/push") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ RESTHeaders.TEXT_CSV }) Response push(@BeanParam AnyQuery anyQuery, @BeanParam CSVPushSpec spec); @@ -117,6 +117,6 @@ public interface ReconciliationService extends JAXRSService { @POST @Path("csv/pull") @Consumes({ RESTHeaders.TEXT_CSV }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List pull(@BeanParam CSVPullSpec spec, InputStream csv); } diff --git a/common/idm/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RemediationService.java b/common/idm/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RemediationService.java index d8295ea7621..f223ce51b99 100644 --- a/common/idm/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RemediationService.java +++ b/common/idm/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RemediationService.java @@ -66,7 +66,7 @@ public interface RemediationService extends JAXRSService { * @return list of all remediations. */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) PagedResult list(@BeanParam RemediationQuery query); /** @@ -77,7 +77,7 @@ public interface RemediationService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) RemediationTO read(@NotNull @PathParam("key") String key); /** @@ -88,7 +88,7 @@ public interface RemediationService extends JAXRSService { */ @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) Response delete(@NotNull @PathParam("key") String key); /** @@ -127,8 +127,8 @@ public interface RemediationService extends JAXRSService { + "client about the fact that a specified preference was applied") })) @POST @Path("{remediationKey}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response remedy(@NotNull @PathParam("remediationKey") String remediationKey, @NotNull AnyCR createReq); /** @@ -169,8 +169,8 @@ public interface RemediationService extends JAXRSService { + " date of the entity") }) @PATCH @Path("{remediationKey}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response remedy(@NotNull @PathParam("remediationKey") String remediationKey, @NotNull AnyUR updateReq); /** @@ -211,7 +211,7 @@ public interface RemediationService extends JAXRSService { + " date of the entity") }) @DELETE @Path("{remediationKey}/{anyKey}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) Response remedy( @NotNull @PathParam("remediationKey") String remediationKey, @NotNull @PathParam("anyKey") String anyKey); diff --git a/common/idm/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java b/common/idm/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java index f9bd005aadd..f4c912b2e50 100644 --- a/common/idm/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java +++ b/common/idm/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ResourceService.java @@ -93,7 +93,7 @@ Response getConnObjectKeyValue( */ @GET @Path("{key}/{anyTypeKey}/{value}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) ConnObject readConnObject( @NotNull @PathParam("key") String key, @NotNull @PathParam("anyTypeKey") String anyTypeKey, @@ -110,7 +110,7 @@ ConnObject readConnObject( */ @GET @Path("{key}/{anyTypeKey}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) PagedConnObjectResult searchConnObjects( @NotNull @PathParam("key") String key, @NotNull @PathParam("anyTypeKey") String anyTypeKey, @@ -124,7 +124,7 @@ PagedConnObjectResult searchConnObjects( */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) ResourceTO read(@NotNull @PathParam("key") String key); /** @@ -133,7 +133,7 @@ PagedConnObjectResult searchConnObjects( * @return list of all resources */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -152,8 +152,8 @@ PagedConnObjectResult searchConnObjects( @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull ResourceTO resourceTO); /** @@ -167,8 +167,8 @@ PagedConnObjectResult searchConnObjects( @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull ResourceTO resourceTO); /** @@ -182,7 +182,7 @@ PagedConnObjectResult searchConnObjects( @ApiResponse(responseCode = "204", description = "Operation was successful")) @POST @Path("{key}/{anyTypeKey}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void setLatestSyncToken( @NotNull @PathParam("key") String key, @NotNull @PathParam("anyTypeKey") String anyTypeKey); @@ -197,7 +197,7 @@ void setLatestSyncToken( @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}/{anyTypeKey}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void removeSyncToken( @NotNull @PathParam("key") String key, @NotNull @PathParam("anyTypeKey") String anyTypeKey); @@ -211,8 +211,8 @@ void removeSyncToken( @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); /** @@ -224,7 +224,7 @@ void removeSyncToken( @ApiResponse(responseCode = "204", description = "Operation was successful")) @POST @Path("check") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) void check(@NotNull ResourceTO resourceTO); } diff --git a/common/idrepo/lib/pom.xml b/common/idrepo/lib/pom.xml index 70ae5e27710..a0d6b4ddaf2 100644 --- a/common/idrepo/lib/pom.xml +++ b/common/idrepo/lib/pom.xml @@ -56,14 +56,6 @@ under the License. com.fasterxml.jackson.core jackson-annotations - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/Attr.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/Attr.java index a7ebc2f458d..ee989a72cd2 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/Attr.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/Attr.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import jakarta.ws.rs.PathParam; import java.util.ArrayList; import java.util.Collection; @@ -91,8 +89,6 @@ public void setSchema(final String schema) { /** * @return attribute values as strings */ - @JacksonXmlElementWrapper(localName = "values") - @JacksonXmlProperty(localName = "value") @JsonProperty(required = true) public List getValues() { return values; diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/form/FormProperty.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/form/FormProperty.java index e0136cac8dd..e762e3fe0a7 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/form/FormProperty.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/form/FormProperty.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.form; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -123,14 +121,10 @@ public void setDatePattern(final String datePattern) { this.datePattern = datePattern; } - @JacksonXmlElementWrapper(localName = "enumValues") - @JacksonXmlProperty(localName = "enumValue") public List getEnumValues() { return enumValues; } - @JacksonXmlElementWrapper(localName = "dropdownValues") - @JacksonXmlProperty(localName = "dropdownValue") public List getDropdownValues() { return dropdownValues; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/form/SyncopeForm.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/form/SyncopeForm.java index 7ea4a1ee286..2e781109f03 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/form/SyncopeForm.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/form/SyncopeForm.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.form; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -39,8 +37,6 @@ public Optional getProperty(final String id) { return properties.stream().filter(property -> id.equals(property.getId())).findFirst(); } - @JacksonXmlElementWrapper(localName = "properties") - @JacksonXmlProperty(localName = "property") public List getProperties() { return properties; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/info/JavaImplInfo.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/info/JavaImplInfo.java index 379df8c70db..7de3d893113 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/info/JavaImplInfo.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/info/JavaImplInfo.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.info; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.HashSet; import java.util.Set; import org.apache.syncope.common.lib.BaseBean; @@ -40,8 +38,6 @@ public void setType(final String type) { this.type = type; } - @JacksonXmlElementWrapper(localName = "classes") - @JacksonXmlProperty(localName = "class") public Set getClasses() { return classes; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java index c81cd389e7a..190465f1b66 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/info/PlatformInfo.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.info; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -66,44 +64,30 @@ public boolean isPwdResetRequiringSecurityQuestions() { return pwdResetRequiringSecurityQuestions; } - @JacksonXmlElementWrapper(localName = "connIdLocations") - @JacksonXmlProperty(localName = "connIdLocation") public Set getConnIdLocations() { return connIdLocations; } - @JacksonXmlElementWrapper(localName = "anyTypes") - @JacksonXmlProperty(localName = "anyType") public List getAnyTypes() { return anyTypes; } - @JacksonXmlElementWrapper(localName = "userClasses") - @JacksonXmlProperty(localName = "userClass") public List getUserClasses() { return userClasses; } - @JacksonXmlElementWrapper(localName = "anyTypeClasses") - @JacksonXmlProperty(localName = "anyTypeClass") public List getAnyTypeClasses() { return anyTypeClasses; } - @JacksonXmlElementWrapper(localName = "resources") - @JacksonXmlProperty(localName = "resource") public List getResources() { return resources; } - @JacksonXmlElementWrapper(localName = "entitlements") - @JacksonXmlProperty(localName = "entitlement") public Set getEntitlements() { return entitlements; } - @JacksonXmlElementWrapper(localName = "implementationTypes") - @JacksonXmlProperty(localName = "implementationType") public Set getImplementationTypes() { return implementationTypes; } @@ -113,8 +97,6 @@ public Optional getJavaImplInfo(final String type) { return javaImplInfos.stream().filter(javaImplInfo -> javaImplInfo.getType().equals(type)).findFirst(); } - @JacksonXmlElementWrapper(localName = "javaImplInfos") - @JacksonXmlProperty(localName = "javaImplInfo") public Set getJavaImplInfos() { return javaImplInfos; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/jackson/SyncopeXmlMapper.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/jackson/SyncopeXmlMapper.java deleted file mode 100644 index 48c26a4c562..00000000000 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/jackson/SyncopeXmlMapper.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.common.lib.jackson; - -import com.ctc.wstx.stax.WstxOutputFactory; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.dataformat.xml.XmlFactory; -import com.fasterxml.jackson.dataformat.xml.XmlMapper; -import com.fasterxml.jackson.dataformat.xml.deser.FromXmlParser; -import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; - -public class SyncopeXmlMapper extends XmlMapper { - - private static final long serialVersionUID = 1022020055828974308L; - - public SyncopeXmlMapper() { - super(new XmlFactory() { - - private static final long serialVersionUID = 1022020055828974306L; - - @Override - protected void _initFactories(final XMLInputFactory xmlIn, final XMLOutputFactory xmlOut) { - super._initFactories(xmlIn, xmlOut); - xmlOut.setProperty(WstxOutputFactory.P_AUTOMATIC_EMPTY_ELEMENTS, Boolean.FALSE); - } - }); - - findAndRegisterModules(); - - configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); - configure(SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS, false); - - configOverride(List.class).setSetterInfo(JsonSetter.Value.forValueNulls(Nulls.AS_EMPTY)); - configOverride(Set.class).setSetterInfo(JsonSetter.Value.forValueNulls(Nulls.AS_EMPTY)); - configOverride(Map.class).setSetterInfo(JsonSetter.Value.forValueNulls(Nulls.AS_EMPTY)); - - enable(ToXmlGenerator.Feature.WRITE_XML_DECLARATION); - enable(FromXmlParser.Feature.EMPTY_ELEMENT_AS_NULL); - } -} diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/jackson/SyncopeYAMLMapper.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/jackson/SyncopeYAMLMapper.java deleted file mode 100644 index 9678c460b74..00000000000 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/jackson/SyncopeYAMLMapper.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.common.lib.jackson; - -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; - -public class SyncopeYAMLMapper extends YAMLMapper { - - private static final long serialVersionUID = 1022020055828974308L; - - public SyncopeYAMLMapper() { - super(); - - findAndRegisterModules(); - - configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); - } -} diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/AccountPolicyTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/AccountPolicyTO.java index dc620dda232..2f6fbdeb7b5 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/AccountPolicyTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/AccountPolicyTO.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.policy; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.List; @@ -38,7 +36,6 @@ public class AccountPolicyTO extends PolicyTO implements ComposablePolicy { private final List passthroughResources = new ArrayList<>(); - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.policy.AccountPolicyTO") @@ -63,16 +60,13 @@ public void setMaxAuthenticationAttempts(final int maxAuthenticationAttempts) { this.maxAuthenticationAttempts = maxAuthenticationAttempts; } - @JacksonXmlElementWrapper(localName = "rules") - @JacksonXmlProperty(localName = "rule") @Override public List getRules() { return rules; } @Schema(accessMode = Schema.AccessMode.READ_ONLY) - @JacksonXmlElementWrapper(localName = "passthroughResources") - @JacksonXmlProperty(localName = "passthroughResource") + public List getPassthroughResources() { return passthroughResources; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAccountRuleConf.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAccountRuleConf.java index 75f84b0986c..9f653ab4f89 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAccountRuleConf.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultAccountRuleConf.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.policy; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.List; import org.apache.syncope.common.lib.Schema; @@ -117,26 +115,18 @@ public void setPattern(final String pattern) { this.pattern = pattern; } - @JacksonXmlElementWrapper(localName = "wordsNotPermitted") - @JacksonXmlProperty(localName = "word") public List getWordsNotPermitted() { return wordsNotPermitted; } - @JacksonXmlElementWrapper(localName = "prefixesNotPermitted") - @JacksonXmlProperty(localName = "prefix") public List getPrefixesNotPermitted() { return prefixesNotPermitted; } - @JacksonXmlElementWrapper(localName = "schemasNotPermitted") - @JacksonXmlProperty(localName = "schema") public List getSchemasNotPermitted() { return schemasNotPermitted; } - @JacksonXmlElementWrapper(localName = "suffixesNotPermitted") - @JacksonXmlProperty(localName = "suffix") public List getSuffixesNotPermitted() { return suffixesNotPermitted; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultPasswordRuleConf.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultPasswordRuleConf.java index 68ace87d119..e38c3bcb306 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultPasswordRuleConf.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/DefaultPasswordRuleConf.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.policy; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.List; import org.apache.syncope.common.lib.Schema; @@ -123,14 +121,10 @@ public void setSpecial(final int special) { this.special = special; } - @JacksonXmlElementWrapper(localName = "specialChars") - @JacksonXmlProperty(localName = "char") public List getSpecialChars() { return specialChars; } - @JacksonXmlElementWrapper(localName = "illegalChars") - @JacksonXmlProperty(localName = "char") public List getIllegalChars() { return illegalChars; } @@ -151,14 +145,10 @@ public void setUsernameAllowed(final boolean usernameAllowed) { this.usernameAllowed = usernameAllowed; } - @JacksonXmlElementWrapper(localName = "wordsNotPermitted") - @JacksonXmlProperty(localName = "word") public List getWordsNotPermitted() { return wordsNotPermitted; } - @JacksonXmlElementWrapper(localName = "schemasNotPermitted") - @JacksonXmlProperty(localName = "schema") public List getSchemasNotPermitted() { return schemasNotPermitted; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/PasswordPolicyTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/PasswordPolicyTO.java index 2dd3a9b799b..cbe4e029371 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/PasswordPolicyTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/PasswordPolicyTO.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.policy; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.List; @@ -38,7 +36,6 @@ public class PasswordPolicyTO extends PolicyTO implements ComposablePolicy { private final List rules = new ArrayList<>(); - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.policy.PasswordPolicyTO") @@ -63,8 +60,6 @@ public void setHistoryLength(final int historyLength) { this.historyLength = historyLength; } - @JacksonXmlElementWrapper(localName = "rules") - @JacksonXmlProperty(localName = "rule") @Override public List getRules() { return rules; diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/PolicyTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/PolicyTO.java index 32eb0539dfa..9c54e2cb51a 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/PolicyTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/policy/PolicyTO.java @@ -21,8 +21,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.ws.rs.PathParam; import java.util.ArrayList; @@ -38,7 +36,6 @@ public abstract class PolicyTO implements NamedEntityTO { private static final long serialVersionUID = -2903888572649721035L; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") private String discriminator; @@ -81,15 +78,13 @@ public void setName(final String name) { } @Schema(accessMode = Schema.AccessMode.READ_ONLY) - @JacksonXmlElementWrapper(localName = "usedByResources") - @JacksonXmlProperty(localName = "resource") + public List getUsedByResources() { return usedByResources; } @Schema(accessMode = Schema.AccessMode.READ_ONLY) - @JacksonXmlElementWrapper(localName = "usedByRealms") - @JacksonXmlProperty(localName = "group") + public List getUsedByRealms() { return usedByRealms; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/AnyCR.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/AnyCR.java index 9c2bb11e098..de67729df1b 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/AnyCR.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/AnyCR.java @@ -22,8 +22,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.Collection; @@ -140,7 +138,6 @@ public R build() { } } - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") private String discriminator; @@ -183,8 +180,6 @@ public Optional getPlainAttr(final String schema) { return plainAttrs.stream().filter(attr -> attr.getSchema().equals(schema)).findFirst(); } - @JacksonXmlElementWrapper(localName = "plainAttrs") - @JacksonXmlProperty(localName = "plainAttr") @Override public Set getPlainAttrs() { return plainAttrs; @@ -202,8 +197,6 @@ public Set getDerAttrs() { return Set.of(); } - @JacksonXmlElementWrapper(localName = "resources") - @JacksonXmlProperty(localName = "resource") @Override public Set getResources() { return resources; @@ -217,8 +210,6 @@ public Optional getRelationship(final String type, final String findFirst(); } - @JacksonXmlElementWrapper(localName = "relationships") - @JacksonXmlProperty(localName = "relationship") @Override public List getRelationships() { return relationships; diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/AnyObjectCR.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/AnyObjectCR.java index 7925d4be76b..c35f1ffd89c 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/AnyObjectCR.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/AnyObjectCR.java @@ -21,8 +21,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.Collection; @@ -74,7 +72,6 @@ public Builder memberships(final Collection memberships) { private final List memberships = new ArrayList<>(); - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.request.AnyObjectCR") @@ -107,8 +104,6 @@ public Optional getMembership(final String groupKey) { return memberships.stream().filter(membership -> groupKey.equals(membership.getGroupKey())).findFirst(); } - @JacksonXmlElementWrapper(localName = "memberships") - @JacksonXmlProperty(localName = "membership") @Override public List getMemberships() { return memberships; diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/AnyObjectUR.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/AnyObjectUR.java index 156047c642d..d81c1a5a120 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/AnyObjectUR.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/AnyObjectUR.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.request; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.Collection; import java.util.HashSet; @@ -70,7 +68,6 @@ public Builder memberships(final Collection memberships) { private final Set memberships = new HashSet<>(); - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.request.AnyObjectUR") @@ -87,8 +84,6 @@ public void setName(final StringReplacePatchItem name) { this.name = name; } - @JacksonXmlElementWrapper(localName = "memberships") - @JacksonXmlProperty(localName = "membership") public Set getMemberships() { return memberships; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/AnyUR.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/AnyUR.java index e3f931077d9..3716ca7f83f 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/AnyUR.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/AnyUR.java @@ -22,8 +22,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.ws.rs.PathParam; import java.util.Collection; @@ -141,7 +139,6 @@ public R build() { } } - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") private String discriminator; @@ -182,26 +179,18 @@ public void setRealm(final StringReplacePatchItem realm) { this.realm = realm; } - @JacksonXmlElementWrapper(localName = "auxClasses") - @JacksonXmlProperty(localName = "auxClass") public Set getAuxClasses() { return auxClasses; } - @JacksonXmlElementWrapper(localName = "plainAttrs") - @JacksonXmlProperty(localName = "plainAttr") public Set getPlainAttrs() { return plainAttrs; } - @JacksonXmlElementWrapper(localName = "resources") - @JacksonXmlProperty(localName = "resource") public Set getResources() { return resources; } - @JacksonXmlElementWrapper(localName = "relationships") - @JacksonXmlProperty(localName = "relationship") public Set getRelationships() { return relationships; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/GroupCR.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/GroupCR.java index bcf529504d8..767f1a1a9d2 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/GroupCR.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/GroupCR.java @@ -20,8 +20,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.Collection; @@ -98,7 +96,6 @@ public Builder typeExtensions(final Collection typeExtensions) private final List typeExtensions = new ArrayList<>(); - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.request.GroupCR") @@ -144,8 +141,6 @@ public Map getADynMembershipConds() { return adynMembershipConds; } - @JacksonXmlElementWrapper(localName = "typeExtensions") - @JacksonXmlProperty(localName = "typeExtension") public List getTypeExtensions() { return typeExtensions; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/GroupUR.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/GroupUR.java index d28b933f304..38756c04692 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/GroupUR.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/GroupUR.java @@ -20,8 +20,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.Collection; @@ -107,7 +105,6 @@ public Builder typeExtensions(final Collection typeExtensions) private final List typeExtensions = new ArrayList<>(); - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.request.GroupUR") @@ -158,8 +155,6 @@ public Optional getTypeExtension(final String anyType) { typeExtension -> anyType != null && anyType.equals(typeExtension.getAnyType())).findFirst(); } - @JacksonXmlElementWrapper(localName = "typeExtensions") - @JacksonXmlProperty(localName = "typeExtension") public List getTypeExtensions() { return typeExtensions; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/MembershipUR.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/MembershipUR.java index 44d6ea16703..44c18d774aa 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/MembershipUR.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/MembershipUR.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.request; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.Collection; import java.util.HashSet; import java.util.List; @@ -72,8 +70,6 @@ public void setGroup(final String group) { this.group = group; } - @JacksonXmlElementWrapper(localName = "plainAttrs") - @JacksonXmlProperty(localName = "plainAttr") public Set getPlainAttrs() { return plainAttrs; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/PasswordPatch.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/PasswordPatch.java index 6202c05ec19..0720c0c29e5 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/PasswordPatch.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/PasswordPatch.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.request; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -80,8 +78,6 @@ public void setOnSyncope(final boolean onSyncope) { this.onSyncope = onSyncope; } - @JacksonXmlElementWrapper(localName = "resources") - @JacksonXmlProperty(localName = "resource") public List getResources() { return resources; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/RelationshipUR.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/RelationshipUR.java index 387de321a71..84c892786c4 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/RelationshipUR.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/RelationshipUR.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.request; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.Collection; import java.util.HashSet; import java.util.List; @@ -87,8 +85,6 @@ public void setOtherEndKey(final String otherEndKey) { this.otherEndKey = otherEndKey; } - @JacksonXmlElementWrapper(localName = "plainAttrs") - @JacksonXmlProperty(localName = "plainAttr") public Set getPlainAttrs() { return plainAttrs; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/ResourceDR.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/ResourceDR.java index 579815f31c4..ebb4bda708e 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/ResourceDR.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/ResourceDR.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.request; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import jakarta.ws.rs.PathParam; import java.util.ArrayList; import java.util.Collection; @@ -100,8 +98,6 @@ public void setAction(final ResourceDeassociationAction action) { this.action = action; } - @JacksonXmlElementWrapper(localName = "resources") - @JacksonXmlProperty(localName = "resource") public List getResources() { return resources; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/UserCR.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/UserCR.java index 2564fb66b5b..ba10009792b 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/UserCR.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/UserCR.java @@ -21,8 +21,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.Collection; @@ -143,7 +141,6 @@ public Builder linkedAccounts(final Collection linkedAccounts) private final List linkedAccounts = new ArrayList<>(); - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.request.UserCR") @@ -207,8 +204,6 @@ public Optional getMembership(final String groupKey) { return memberships.stream().filter(membership -> groupKey.equals(membership.getGroupKey())).findFirst(); } - @JacksonXmlElementWrapper(localName = "memberships") - @JacksonXmlProperty(localName = "membership") @Override public List getMemberships() { return memberships; @@ -220,14 +215,10 @@ public List getDynMemberships() { return List.of(); } - @JacksonXmlElementWrapper(localName = "roles") - @JacksonXmlProperty(localName = "role") public Set getRoles() { return roles; } - @JacksonXmlElementWrapper(localName = "linkedAccounts") - @JacksonXmlProperty(localName = "linkedAccount") public List getLinkedAccounts() { return linkedAccounts; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/UserUR.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/UserUR.java index 193495f1035..8d6a4eacb96 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/UserUR.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/request/UserUR.java @@ -20,8 +20,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.Collection; @@ -119,7 +117,6 @@ public Builder roles(final Collection roles) { private final List linkedAccounts = new ArrayList<>(); - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.request.UserUR") @@ -168,20 +165,14 @@ public void setMustChangePassword(final BooleanReplacePatchItem mustChangePasswo this.mustChangePassword = mustChangePassword; } - @JacksonXmlElementWrapper(localName = "memberships") - @JacksonXmlProperty(localName = "membership") public Set getMemberships() { return memberships; } - @JacksonXmlElementWrapper(localName = "roles") - @JacksonXmlProperty(localName = "role") public Set getRoles() { return roles; } - @JacksonXmlElementWrapper(localName = "linkedAccounts") - @JacksonXmlProperty(localName = "linkedAccount") public List getLinkedAccounts() { return linkedAccounts; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java index 39d283ebb49..e588ed853eb 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java @@ -20,8 +20,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.List; @@ -40,7 +38,6 @@ public class AnyObjectTO extends AnyTO implements GroupableRelatableTO { private final List dynMemberships = new ArrayList<>(); - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.to.AnyObjectTO") @@ -63,15 +60,11 @@ public Optional getMembership(final String groupKey) { return memberships.stream().filter(membership -> groupKey.equals(membership.getGroupKey())).findFirst(); } - @JacksonXmlElementWrapper(localName = "memberships") - @JacksonXmlProperty(localName = "membership") @Override public List getMemberships() { return memberships; } - @JacksonXmlElementWrapper(localName = "dynMemberships") - @JacksonXmlProperty(localName = "dynMembership") @Override public List getDynMemberships() { return dynMemberships; diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTO.java index 32851b29583..e76ea4ab305 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTO.java @@ -22,8 +22,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.time.OffsetDateTime; import java.util.ArrayList; @@ -44,7 +42,6 @@ public abstract class AnyTO implements EntityTO, RealmMember, RelatableTO { private static final long serialVersionUID = -754311920679872084L; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") private String discriminator; @@ -184,8 +181,6 @@ public void setRealm(final String realm) { this.realm = realm; } - @JacksonXmlElementWrapper(localName = "dynRealms") - @JacksonXmlProperty(localName = "dynRealmF") public List getDynRealms() { return dynRealms; } @@ -198,15 +193,11 @@ public void setStatus(final String status) { this.status = status; } - @JacksonXmlElementWrapper(localName = "auxClasses") - @JacksonXmlProperty(localName = "class") @Override public Set getAuxClasses() { return auxClasses; } - @JacksonXmlElementWrapper(localName = "plainAttrs") - @JacksonXmlProperty(localName = "plainAttr") @Override public Set getPlainAttrs() { return plainAttrs; @@ -218,8 +209,6 @@ public Optional getPlainAttr(final String schema) { return plainAttrs.stream().filter(attr -> attr.getSchema().equals(schema)).findFirst(); } - @JacksonXmlElementWrapper(localName = "derAttrs") - @JacksonXmlProperty(localName = "derAttr") @Override public Set getDerAttrs() { return derAttrs; @@ -244,8 +233,6 @@ public Optional getRelationship(final String type, final String findFirst(); } - @JacksonXmlElementWrapper(localName = "relationships") - @JacksonXmlProperty(localName = "relationship") @Override public List getRelationships() { return relationships; diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTypeClassTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTypeClassTO.java index fb99fcefdc9..aeb6754ed4a 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTypeClassTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTypeClassTO.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import jakarta.ws.rs.PathParam; import java.util.ArrayList; import java.util.List; @@ -47,20 +45,14 @@ public void setKey(final String key) { this.key = key; } - @JacksonXmlElementWrapper(localName = "plainSchemas") - @JacksonXmlProperty(localName = "plainSchema") public List getPlainSchemas() { return plainSchemas; } - @JacksonXmlElementWrapper(localName = "derSchemas") - @JacksonXmlProperty(localName = "derSchema") public List getDerSchemas() { return derSchemas; } - @JacksonXmlElementWrapper(localName = "inUseByTypes") - @JacksonXmlProperty(localName = "inUseByType") public List getInUseByTypes() { return inUseByTypes; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTypeTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTypeTO.java index f6f3de453cf..ddf1e83efae 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTypeTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTypeTO.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import jakarta.ws.rs.PathParam; import java.util.ArrayList; import java.util.List; @@ -56,8 +54,6 @@ public void setKind(final AnyTypeKind kind) { this.kind = kind; } - @JacksonXmlElementWrapper(localName = "classes") - @JacksonXmlProperty(localName = "class") public List getClasses() { return classes; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AuditEventTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AuditEventTO.java index 081a0399b15..1fca26b8fe8 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AuditEventTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/AuditEventTO.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import jakarta.ws.rs.PathParam; import java.time.OffsetDateTime; import java.util.ArrayList; @@ -91,8 +89,6 @@ public void setBefore(final String before) { this.before = before; } - @JacksonXmlElementWrapper(localName = "inputs") - @JacksonXmlProperty(localName = "input") public List getInputs() { return inputs; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ConnObject.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ConnObject.java index c26b85937b2..17b630bd761 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ConnObject.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ConnObject.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.Optional; import java.util.Set; import java.util.TreeSet; @@ -45,8 +43,6 @@ public void setFiql(final String fiql) { this.fiql = fiql; } - @JacksonXmlElementWrapper(localName = "attrs") - @JacksonXmlProperty(localName = "attr") public Set getAttrs() { return attrs; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/DelegationTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/DelegationTO.java index e219a9b0a3e..373aa95f4a7 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/DelegationTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/DelegationTO.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.ws.rs.PathParam; import java.time.OffsetDateTime; @@ -69,8 +67,6 @@ public void setDelegated(final String delegated) { this.delegated = delegated; } - @JacksonXmlElementWrapper(localName = "roles") - @JacksonXmlProperty(localName = "role") public Set getRoles() { return roles; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/DerSchemaTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/DerSchemaTO.java index 08eb254dc3e..b3b06098342 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/DerSchemaTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/DerSchemaTO.java @@ -19,7 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -31,7 +30,6 @@ public class DerSchemaTO extends SchemaTO { private String expression; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.to.DerSchemaTO") diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ErrorTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ErrorTO.java index 4460ae16add..3b7d31cb183 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ErrorTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ErrorTO.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.List; import org.apache.syncope.common.lib.BaseBean; @@ -51,8 +49,6 @@ public void setType(final ClientExceptionType type) { this.type = type; } - @JacksonXmlElementWrapper(localName = "elements") - @JacksonXmlProperty(localName = "element") public List getElements() { return elements; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java index acb8cd9e769..80305b712f8 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java @@ -20,8 +20,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.HashMap; @@ -57,7 +55,6 @@ public class GroupTO extends AnyTO implements TypeExtensionHolderTO { private final List typeExtensions = new ArrayList<>(); - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.to.GroupTO") @@ -152,8 +149,6 @@ public Optional getTypeExtension(final String anyType) { findFirst(); } - @JacksonXmlElementWrapper(localName = "typeExtensions") - @JacksonXmlProperty(localName = "typeExtension") @Override public List getTypeExtensions() { return typeExtensions; diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/Item.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/Item.java index 7a41bb26da7..d43b8c39bea 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/Item.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/Item.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -139,8 +137,6 @@ public void setPullJEXLTransformer(final String pullJEXLTransformer) { this.pullJEXLTransformer = pullJEXLTransformer; } - @JacksonXmlElementWrapper(localName = "transformers") - @JacksonXmlProperty(localName = "transformer") public List getTransformers() { return transformers; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ItemContainer.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ItemContainer.java index 40d7a776f69..3ca4a2dfea8 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ItemContainer.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ItemContainer.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -52,8 +50,6 @@ public boolean setConnObjectKeyItem(final Item connObjectKeyItem) { orElseGet(() -> getConnObjectKeyItem().map(items::remove).orElse(false)); } - @JacksonXmlElementWrapper(localName = "items") - @JacksonXmlProperty(localName = "item") public List getItems() { return items; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/LinkedAccountTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/LinkedAccountTO.java index 63475822f36..6211dd9abc6 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/LinkedAccountTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/LinkedAccountTO.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.Optional; import java.util.Set; import java.util.TreeSet; @@ -130,8 +128,6 @@ public void setSuspended(final boolean suspended) { this.suspended = suspended; } - @JacksonXmlElementWrapper(localName = "plainAttrs") - @JacksonXmlProperty(localName = "plainAttr") public Set getPlainAttrs() { return plainAttrs; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/LiveSyncTaskTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/LiveSyncTaskTO.java index c6c79200145..40f4788c236 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/LiveSyncTaskTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/LiveSyncTaskTO.java @@ -19,7 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.HashMap; import java.util.Map; @@ -37,7 +36,6 @@ public class LiveSyncTaskTO extends InboundTaskTO implements TemplatableTO { private final Map templates = new HashMap<>(); - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.to.LiveSyncTaskTO") diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/MacroTaskTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/MacroTaskTO.java index 1685d72aea3..db26ae7ce9e 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/MacroTaskTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/MacroTaskTO.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.List; @@ -45,7 +43,6 @@ public class MacroTaskTO extends SchedTaskTO { private String macroActions; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.to.MacroTaskTO") @@ -62,8 +59,6 @@ public void setRealm(final String realm) { this.realm = realm; } - @JacksonXmlElementWrapper(localName = "commands") - @JacksonXmlProperty(localName = "command") public List getCommands() { return commands; } @@ -84,8 +79,6 @@ public void setSaveExecs(final boolean saveExecs) { this.saveExecs = saveExecs; } - @JacksonXmlElementWrapper(localName = "formPropertyDefs") - @JacksonXmlProperty(localName = "formPropertyDef") public List getFormPropertyDefs() { return formPropertyDefs; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/MembershipTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/MembershipTO.java index 7f3045ce0bf..361b050f4cd 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/MembershipTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/MembershipTO.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.Collection; import java.util.List; import java.util.Optional; @@ -94,8 +92,6 @@ public void setGroupName(final String groupName) { this.groupName = groupName; } - @JacksonXmlElementWrapper(localName = "plainAttrs") - @JacksonXmlProperty(localName = "plainAttr") @Override public Set getPlainAttrs() { return plainAttrs; @@ -107,8 +103,6 @@ public Optional getPlainAttr(final String schema) { return plainAttrs.stream().filter(attr -> attr.getSchema().equals(schema)).findFirst(); } - @JacksonXmlElementWrapper(localName = "derAttrs") - @JacksonXmlProperty(localName = "derAttr") @Override public Set getDerAttrs() { return derAttrs; diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTO.java index 565a172f7d0..5294550759e 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTO.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import jakarta.ws.rs.PathParam; import java.util.ArrayList; import java.util.HashMap; @@ -63,14 +61,10 @@ public Map getAbouts() { return abouts; } - @JacksonXmlElementWrapper(localName = "events") - @JacksonXmlProperty(localName = "event") public List getEvents() { return events; } - @JacksonXmlElementWrapper(localName = "staticRecipients") - @JacksonXmlProperty(localName = "staticRecipient") public List getStaticRecipients() { return staticRecipients; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTaskTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTaskTO.java index bcc36b4ab74..c537f638b89 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTaskTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTaskTO.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.Set; import java.util.TreeSet; @@ -54,7 +52,6 @@ public class NotificationTaskTO extends TaskTO { private TraceLevel traceLevel; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.to.NotificationTaskTO") @@ -91,8 +88,7 @@ public void setEntityKey(final String entityKey) { } @Schema(accessMode = Schema.AccessMode.READ_ONLY) - @JacksonXmlElementWrapper(localName = "recipients") - @JacksonXmlProperty(localName = "recipient") + public Set getRecipients() { return recipients; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PagedResult.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PagedResult.java index 4044e7d5e9f..69d6b2111eb 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PagedResult.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PagedResult.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.net.URI; import java.util.ArrayList; import java.util.List; @@ -59,8 +57,6 @@ public void setNext(final URI next) { this.next = next; } - @JacksonXmlElementWrapper(localName = "result") - @JacksonXmlProperty(localName = "item") public List getResult() { return result; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PlainSchemaTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PlainSchemaTO.java index 5f45a239b7c..323de0f8eab 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PlainSchemaTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PlainSchemaTO.java @@ -19,7 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.HashMap; import java.util.Map; @@ -58,7 +57,6 @@ public class PlainSchemaTO extends SchemaTO { private String mimeType; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.to.PlainSchemaTO") diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PropagationTaskTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PropagationTaskTO.java index e90bfc65e50..9f2faeb6f8c 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PropagationTaskTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PropagationTaskTO.java @@ -19,7 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -51,7 +50,6 @@ public class PropagationTaskTO extends TaskTO { private String entityKey; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.to.PropagationTaskTO") diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningResult.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningResult.java index 94702842c21..acd4acb9a1c 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningResult.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningResult.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.builder.EqualsBuilder; @@ -42,8 +40,6 @@ public void setEntity(final E entity) { this.entity = entity; } - @JacksonXmlElementWrapper(localName = "propagationStatuses") - @JacksonXmlProperty(localName = "propagationStatus") public List getPropagationStatuses() { return propagationStatuses; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningTaskTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningTaskTO.java index dbc0366daf2..87d361fb0ae 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningTaskTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningTaskTO.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.ArrayList; import java.util.List; @@ -111,8 +109,6 @@ public void setMatchingRule(final MatchingRule matchigRule) { this.matchingRule = matchigRule; } - @JacksonXmlElementWrapper(localName = "actions") - @JacksonXmlProperty(localName = "action") public List getActions() { return actions; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PullTaskTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PullTaskTO.java index dd0b7af1c2d..41ec8ade0c8 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PullTaskTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PullTaskTO.java @@ -19,7 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.HashMap; import java.util.Map; @@ -37,7 +36,6 @@ public class PullTaskTO extends InboundTaskTO implements TemplatableTO { private String reconFilterBuilder; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.to.PullTaskTO") diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PushTaskTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PushTaskTO.java index abf91f65fc8..74c49ff57e2 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PushTaskTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/PushTaskTO.java @@ -19,7 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.util.HashMap; import java.util.Map; @@ -36,7 +35,6 @@ public class PushTaskTO extends ProvisioningTaskTO { private final Map filters = new HashMap<>(); - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.to.PushTaskTO") diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/RealmTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/RealmTO.java index 2e3efc0a079..fe7b613c014 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/RealmTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/RealmTO.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import jakarta.ws.rs.PathParam; import java.util.ArrayList; import java.util.HashMap; @@ -106,8 +104,6 @@ public void setFullPath(final String fullPath) { this.fullPath = fullPath; } - @JacksonXmlElementWrapper(localName = "anyTypeClasses") - @JacksonXmlProperty(localName = "anyTypeClasses") public List getAnyTypeClasses() { return anyTypeClasses; } @@ -160,8 +156,6 @@ public void setTicketExpirationPolicy(final String ticketExpirationPolicy) { this.ticketExpirationPolicy = ticketExpirationPolicy; } - @JacksonXmlElementWrapper(localName = "plainAttrs") - @JacksonXmlProperty(localName = "plainAttr") @Override public Set getPlainAttrs() { return plainAttrs; @@ -173,8 +167,6 @@ public Optional getPlainAttr(final String schema) { return plainAttrs.stream().filter(attr -> attr.getSchema().equals(schema)).findFirst(); } - @JacksonXmlElementWrapper(localName = "derAttrs") - @JacksonXmlProperty(localName = "derAttr") @Override public Set getDerAttrs() { return derAttrs; @@ -186,8 +178,6 @@ public Optional getDerAttr(final String schema) { return derAttrs.stream().filter(attr -> attr.getSchema().equals(schema)).findFirst(); } - @JacksonXmlElementWrapper(localName = "actions") - @JacksonXmlProperty(localName = "action") public List getActions() { return actions; } @@ -197,8 +187,6 @@ public Map getTemplates() { return templates; } - @JacksonXmlElementWrapper(localName = "resources") - @JacksonXmlProperty(localName = "resource") public List getResources() { return resources; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/RelationshipTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/RelationshipTO.java index 2d8533d3047..e2f91dde56f 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/RelationshipTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/RelationshipTO.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.Collection; import java.util.List; import java.util.Optional; @@ -149,8 +147,6 @@ public void setEnd(final End end) { this.end = end; } - @JacksonXmlElementWrapper(localName = "plainAttrs") - @JacksonXmlProperty(localName = "plainAttr") @Override public Set getPlainAttrs() { return plainAttrs; @@ -162,8 +158,6 @@ public Optional getPlainAttr(final String schema) { return plainAttrs.stream().filter(attr -> attr.getSchema().equals(schema)).findFirst(); } - @JacksonXmlElementWrapper(localName = "derAttrs") - @JacksonXmlProperty(localName = "derAttr") @Override public Set getDerAttrs() { return derAttrs; diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/RelationshipTypeTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/RelationshipTypeTO.java index 06def5bd42f..11011180907 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/RelationshipTypeTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/RelationshipTypeTO.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import jakarta.ws.rs.Path; import java.util.ArrayList; import java.util.List; @@ -82,8 +80,6 @@ public Optional getTypeExtension(final String anyType) { typeExtension -> anyType != null && anyType.equals(typeExtension.getAnyType())).findFirst(); } - @JacksonXmlElementWrapper(localName = "typeExtensions") - @JacksonXmlProperty(localName = "typeExtension") @Override public List getTypeExtensions() { return typeExtensions; diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ReportTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ReportTO.java index a99e23b41bd..9b32a2ae5c4 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ReportTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/ReportTO.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import jakarta.ws.rs.PathParam; import java.time.OffsetDateTime; import java.util.ArrayList; @@ -108,8 +106,6 @@ public void setJobDelegate(final String jobDelegate) { this.jobDelegate = jobDelegate; } - @JacksonXmlElementWrapper(localName = "executions") - @JacksonXmlProperty(localName = "execution") public List getExecutions() { return executions; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/RoleTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/RoleTO.java index 97f45a3e809..e5d18ea307c 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/RoleTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/RoleTO.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import jakarta.ws.rs.PathParam; import java.util.ArrayList; import java.util.List; @@ -53,20 +51,14 @@ public void setKey(final String key) { this.key = key; } - @JacksonXmlElementWrapper(localName = "entitlements") - @JacksonXmlProperty(localName = "entitlement") public Set getEntitlements() { return entitlements; } - @JacksonXmlElementWrapper(localName = "realms") - @JacksonXmlProperty(localName = "realm") public List getRealms() { return realms; } - @JacksonXmlElementWrapper(localName = "dynRealms") - @JacksonXmlProperty(localName = "dynRealm") public List getDynRealms() { return dynRealms; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/SchedTaskTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/SchedTaskTO.java index 0813f92d4a3..77146facbab 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/SchedTaskTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/SchedTaskTO.java @@ -19,7 +19,6 @@ package org.apache.syncope.common.lib.to; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.time.OffsetDateTime; import org.apache.commons.lang3.builder.EqualsBuilder; @@ -46,7 +45,6 @@ public class SchedTaskTO extends TaskTO implements NamedEntityTO { private boolean active = true; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.to.SchedTaskTO") diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/SchemaTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/SchemaTO.java index f577fea61fa..43ee6f7934a 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/SchemaTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/SchemaTO.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.ws.rs.PathParam; import java.util.HashMap; @@ -38,7 +37,6 @@ public abstract class SchemaTO implements EntityTO { private static final long serialVersionUID = 4088388951694301759L; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") private String discriminator; diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/TaskTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/TaskTO.java index 1b3731fbef9..487e4f94164 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/TaskTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/TaskTO.java @@ -21,8 +21,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.ws.rs.PathParam; import java.util.ArrayList; @@ -41,7 +39,6 @@ public abstract class TaskTO extends AbstractStartEndBean implements EntityTO { private static final long serialVersionUID = 386450127003321197L; - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") private String discriminator; @@ -91,8 +88,7 @@ public void setLastExecutor(final String lastExecutor) { } @Schema(accessMode = Schema.AccessMode.READ_ONLY) - @JacksonXmlElementWrapper(localName = "executions") - @JacksonXmlProperty(localName = "execution") + public List getExecutions() { return executions; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/TypeExtensionTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/TypeExtensionTO.java index 0f35fe1f6c1..03f6dbea254 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/TypeExtensionTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/TypeExtensionTO.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.builder.EqualsBuilder; @@ -42,8 +40,6 @@ public void setAnyType(final String anyType) { this.anyType = anyType; } - @JacksonXmlElementWrapper(localName = "auxClasses") - @JacksonXmlProperty(localName = "class") public List getAuxClasses() { return auxClasses; } diff --git a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java index 49460a47d88..9a4d224944b 100644 --- a/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java +++ b/common/idrepo/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java @@ -20,8 +20,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import io.swagger.v3.oas.annotations.media.Schema; import java.time.OffsetDateTime; import java.util.ArrayList; @@ -72,7 +70,6 @@ public class UserTO extends AnyTO implements GroupableRelatableTO { private final List delegatedDelegations = new ArrayList<>(); - @JacksonXmlProperty(localName = "_class", isAttribute = true) @JsonProperty("_class") @Schema(name = "_class", requiredMode = Schema.RequiredMode.REQUIRED, example = "org.apache.syncope.common.lib.to.UserTO") @@ -186,47 +183,33 @@ public Optional getMembership(final String groupKey) { return memberships.stream().filter(membership -> groupKey.equals(membership.getGroupKey())).findFirst(); } - @JacksonXmlElementWrapper(localName = "memberships") - @JacksonXmlProperty(localName = "membership") @Override public List getMemberships() { return memberships; } - @JacksonXmlElementWrapper(localName = "dynMemberships") - @JacksonXmlProperty(localName = "dynMembership") @Override public List getDynMemberships() { return dynMemberships; } - @JacksonXmlElementWrapper(localName = "roles") - @JacksonXmlProperty(localName = "role") public List getRoles() { return roles; } - @JacksonXmlElementWrapper(localName = "dynRoles") - @JacksonXmlProperty(localName = "dynRole") public List getDynRoles() { return dynRoles; } - @JacksonXmlElementWrapper(localName = "linkedAccounts") - @JacksonXmlProperty(localName = "linkedAccount") public List getLinkedAccounts() { return linkedAccounts; } - @JacksonXmlElementWrapper(localName = "delegatingDelegations") - @JacksonXmlProperty(localName = "delegatingDelegation") @Schema(accessMode = Schema.AccessMode.READ_ONLY) public List getDelegatingDelegations() { return delegatingDelegations; } - @JacksonXmlElementWrapper(localName = "getDelegatedDelegations") - @JacksonXmlProperty(localName = "getDelegatedDelegation") @Schema(accessMode = Schema.AccessMode.READ_ONLY) public List getDelegatedDelegations() { return delegatedDelegations; diff --git a/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java b/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java deleted file mode 100644 index adb47a8f5d9..00000000000 --- a/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/JSONTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.common.lib; - -import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper; - -public class JSONTest extends SerializationTest { - - private static final ObjectMapper OBJECT_MAPPER = new SyncopeJsonMapper(); - - @Override - protected ObjectMapper objectMapper() { - return OBJECT_MAPPER; - } -} diff --git a/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/SerializationTest.java b/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/SerializationTest.java index 8ca429696e2..bd82ee2b3ff 100644 --- a/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/SerializationTest.java +++ b/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/SerializationTest.java @@ -22,12 +22,13 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.json.JsonMapper; import java.io.IOException; import java.io.StringWriter; import java.util.ArrayList; import java.util.List; import java.util.UUID; +import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper; import org.apache.syncope.common.lib.request.AnyObjectCR; import org.apache.syncope.common.lib.request.GroupUR; import org.apache.syncope.common.lib.request.PasswordPatch; @@ -43,19 +44,18 @@ import org.apache.syncope.common.lib.types.PatchOperation; import org.junit.jupiter.api.Test; -public abstract class SerializationTest { +public class SerializationTest { - protected abstract ObjectMapper objectMapper(); + private static final JsonMapper MAPPER = new SyncopeJsonMapper(); @Test public void emptyListAsRoot() throws IOException { List original = new ArrayList<>(); StringWriter writer = new StringWriter(); - objectMapper().writeValue(writer, original); + MAPPER.writeValue(writer, original); - List actual = objectMapper().readValue(writer.toString(), - new TypeReference<>() { + List actual = MAPPER.readValue(writer.toString(), new TypeReference<>() { }); assertEquals(original, actual); } @@ -68,9 +68,9 @@ public void nonEmptyListAsMember() throws IOException { original.getPlainAttrs().add(new Attr.Builder("location").value("new").build()); StringWriter writer = new StringWriter(); - objectMapper().writeValue(writer, original); + MAPPER.writeValue(writer, original); - AnyObjectCR actual = objectMapper().readValue(writer.toString(), AnyObjectCR.class); + AnyObjectCR actual = MAPPER.readValue(writer.toString(), AnyObjectCR.class); assertEquals(original, actual); } @@ -82,9 +82,9 @@ public void map() throws IOException { req.getADynMembershipConds().put("key2", "value2"); StringWriter writer = new StringWriter(); - objectMapper().writeValue(writer, req); + MAPPER.writeValue(writer, req); - GroupUR actual = objectMapper().readValue(writer.toString(), GroupUR.class); + GroupUR actual = MAPPER.readValue(writer.toString(), GroupUR.class); assertEquals(req, actual); } @@ -103,9 +103,9 @@ public void patch() throws IOException { req.getRoles().add(new StringPatchItem.Builder().operation(PatchOperation.DELETE).value("role").build()); StringWriter writer = new StringWriter(); - objectMapper().writeValue(writer, req); + MAPPER.writeValue(writer, req); - UserUR actual = objectMapper().readValue(writer.toString(), UserUR.class); + UserUR actual = MAPPER.readValue(writer.toString(), UserUR.class); assertEquals(req, actual); } @@ -123,9 +123,9 @@ public void pagedResult() throws IOException { original.setTotalCount(1); StringWriter writer = new StringWriter(); - objectMapper().writeValue(writer, original); + MAPPER.writeValue(writer, original); - PagedResult actual = objectMapper().readValue(writer.toString(), new TypeReference<>() { + PagedResult actual = MAPPER.readValue(writer.toString(), new TypeReference<>() { }); assertEquals(original, actual); } @@ -146,9 +146,9 @@ public void provisioningResult() throws IOException { original.getPropagationStatuses().add(status); StringWriter writer = new StringWriter(); - objectMapper().writeValue(writer, original); + MAPPER.writeValue(writer, original); - ProvisioningResult actual = objectMapper().readValue(writer.toString(), new TypeReference<>() { + ProvisioningResult actual = MAPPER.readValue(writer.toString(), new TypeReference<>() { }); assertEquals(original, actual); } diff --git a/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/XMLTest.java b/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/XMLTest.java deleted file mode 100644 index b835f5ed08c..00000000000 --- a/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/XMLTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.common.lib; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.xml.XmlMapper; -import org.apache.syncope.common.lib.jackson.SyncopeXmlMapper; - -public class XMLTest extends SerializationTest { - - private static final XmlMapper XML_MAPPER = new SyncopeXmlMapper(); - - @Override - protected ObjectMapper objectMapper() { - return XML_MAPPER; - } -} diff --git a/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/YAMLTest.java b/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/YAMLTest.java deleted file mode 100644 index 093322a7417..00000000000 --- a/common/idrepo/lib/src/test/java/org/apache/syncope/common/lib/YAMLTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.common.lib; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; -import org.apache.syncope.common.lib.jackson.SyncopeYAMLMapper; - -public class YAMLTest extends SerializationTest { - - private static final YAMLMapper YAML_MAPPER = new SyncopeYAMLMapper(); - - @Override - protected ObjectMapper objectMapper() { - return YAML_MAPPER; - } -} diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/RESTHeaders.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/RESTHeaders.java index 352c652758e..924a3032524 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/RESTHeaders.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/RESTHeaders.java @@ -63,16 +63,6 @@ public final class RESTHeaders { */ public static final String MEDIATYPE_IMAGE_PNG = "image/png"; - /** - * Mediatype for YAML, not defined in {@link jakarta.ws.rs.core.MediaType}. - */ - public static final String APPLICATION_YAML = "application/yaml"; - - /** - * Mediatype for YAML, not defined in {@link jakarta.ws.rs.core.MediaType}. - */ - public static final MediaType APPLICATION_YAML_TYPE = new MediaType("application", "yaml"); - /** * Mediatype for text/csv, not defined in {@link jakarta.ws.rs.core.MediaType}. */ diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AccessTokenService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AccessTokenService.java index c192afb52c0..b23a8c334cd 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AccessTokenService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AccessTokenService.java @@ -66,7 +66,7 @@ public interface AccessTokenService extends JAXRSService { }) @POST @Path("login") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) Response login(); /** @@ -88,7 +88,7 @@ public interface AccessTokenService extends JAXRSService { description = "Expiration of the refreshed JWT") })) @POST @Path("refresh") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) Response refresh(); /** @@ -100,7 +100,7 @@ public interface AccessTokenService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @POST @Path("logout") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void logout(); /** @@ -113,8 +113,8 @@ public interface AccessTokenService extends JAXRSService { @SecurityRequirement(name = "BasicAuthentication"), @SecurityRequirement(name = "Bearer") }) @GET - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) PagedResult list(@BeanParam AccessTokenQuery query); /** @@ -129,6 +129,6 @@ public interface AccessTokenService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@PathParam("key") String key); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyObjectService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyObjectService.java index 919e90b9a32..5e04ae6bc98 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyObjectService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyObjectService.java @@ -76,7 +76,7 @@ public interface AnyObjectService extends AnyService { + " by this endpoint"))) @GET @Path("byName/{type}/{name}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) AnyObjectTO read(@NotNull @PathParam("type") String type, @NotNull @PathParam("name") String name); @Override @@ -117,8 +117,8 @@ public interface AnyObjectService extends AnyService { description = "Allows the server to inform the " + "client about the fact that a specified preference was applied") })) @POST - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) Response create(@NotNull AnyObjectCR createReq); /** @@ -160,7 +160,7 @@ public interface AnyObjectService extends AnyService { + " date of the entity") }) @PATCH @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) Response update(@NotNull AnyObjectUR updateReq); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java index 6b95138bc38..5b01f7acd9e 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyService.java @@ -66,7 +66,7 @@ public interface AnyService extends JAXRSService { */ @GET @Path("{key}/{schemaType}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) Set read(@NotNull @PathParam("key") String key, @NotNull @PathParam("schemaType") SchemaType schemaType); /** @@ -82,7 +82,7 @@ public interface AnyService extends JAXRSService { */ @GET @Path("{key}/{schemaType}/{schema}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) Attr read( @NotNull @PathParam("key") String key, @NotNull @PathParam("schemaType") SchemaType schemaType, @@ -96,7 +96,7 @@ Attr read( */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) TO read(@NotNull @PathParam("key") String key); /** @@ -106,7 +106,7 @@ Attr read( * @return paged list of any objects matching the given query */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) PagedResult search(@BeanParam AnyQuery anyQuery); /** @@ -121,8 +121,8 @@ Attr read( @Schema(type = "string")) @PUT @Path("{key}/{schemaType}/{schema}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) Response update( @NotNull @PathParam("key") String key, @NotNull @PathParam("schemaType") SchemaType schemaType, @@ -140,7 +140,7 @@ Response update( @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}/{schemaType}/{schema}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete( @NotNull @PathParam("key") String key, @NotNull @PathParam("schemaType") SchemaType schemaType, @@ -184,7 +184,7 @@ void delete( + " date of the entity") }) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) Response delete(@NotNull @PathParam("key") String key); /** @@ -225,7 +225,7 @@ void delete( + " date of the entity") }) @POST @Path("{key}/deassociate/{action}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) @Produces(RESTHeaders.MULTIPART_MIXED) Response deassociate(@NotNull ResourceDR req); @@ -267,7 +267,7 @@ void delete( + " date of the entity") }) @POST @Path("{key}/associate/{action}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) @Produces(RESTHeaders.MULTIPART_MIXED) Response associate(@NotNull ResourceAR req); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeClassService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeClassService.java index c45b52e0325..bbcc5d34605 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeClassService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeClassService.java @@ -59,7 +59,7 @@ public interface AnyTypeClassService extends JAXRSService { * @return list of all anyTypeClasss. */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -70,7 +70,7 @@ public interface AnyTypeClassService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) AnyTypeClassTO read(@NotNull @PathParam("key") String key); /** @@ -89,8 +89,8 @@ public interface AnyTypeClassService extends JAXRSService { @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull AnyTypeClassTO anyTypeClassTO); /** @@ -104,8 +104,8 @@ public interface AnyTypeClassService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull AnyTypeClassTO anyTypeClassTO); /** @@ -117,6 +117,6 @@ public interface AnyTypeClassService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeService.java index 9e7089cb339..c558aa7ef83 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AnyTypeService.java @@ -59,7 +59,7 @@ public interface AnyTypeService extends JAXRSService { * @return list of all anyTypes. */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -70,7 +70,7 @@ public interface AnyTypeService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) AnyTypeTO read(@NotNull @PathParam("key") String key); /** @@ -89,7 +89,7 @@ public interface AnyTypeService extends JAXRSService { @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) Response create(@NotNull AnyTypeTO anyTypeTO); /** @@ -103,7 +103,7 @@ public interface AnyTypeService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) void update(@NotNull AnyTypeTO anyTypeTO); /** @@ -115,6 +115,6 @@ public interface AnyTypeService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AuditService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AuditService.java index cfeb638df9d..1ba897e90f2 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AuditService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/AuditService.java @@ -42,7 +42,6 @@ import org.apache.syncope.common.lib.to.AuditEventTO; import org.apache.syncope.common.lib.to.PagedResult; import org.apache.syncope.common.lib.types.OpEvent; -import org.apache.syncope.common.rest.api.RESTHeaders; import org.apache.syncope.common.rest.api.beans.AuditQuery; /** @@ -62,7 +61,7 @@ public interface AuditService extends JAXRSService { */ @GET @Path("conf") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List confs(); /** @@ -73,11 +72,11 @@ public interface AuditService extends JAXRSService { */ @GET @Path("conf/{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) AuditConfTO getConf(@NotNull @PathParam("key") String key); /** - * Sets an audit configuration + * Sets an audit configuration * * @param auditTO audit configuration to be stored */ @@ -87,8 +86,8 @@ public interface AuditService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("conf/{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void setConf(@NotNull AuditConfTO auditTO); /** @@ -100,7 +99,7 @@ public interface AuditService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("conf/{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void deleteConf(@NotNull @PathParam("key") String key); /** @@ -110,7 +109,7 @@ public interface AuditService extends JAXRSService { */ @GET @Path("opEvents") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List events(); /** @@ -121,7 +120,7 @@ public interface AuditService extends JAXRSService { */ @GET @Path("auditEvents") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) PagedResult search(@BeanParam AuditQuery auditQuery); /** @@ -131,6 +130,6 @@ public interface AuditService extends JAXRSService { */ @POST @Path("auditEvents") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) void create(@NotNull AuditEventTO auditEvent); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CommandService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CommandService.java index b702f75e17e..52e1dc18c89 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CommandService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/CommandService.java @@ -35,7 +35,6 @@ import org.apache.syncope.common.lib.command.CommandOutput; import org.apache.syncope.common.lib.command.CommandTO; import org.apache.syncope.common.lib.to.PagedResult; -import org.apache.syncope.common.rest.api.RESTHeaders; import org.apache.syncope.common.rest.api.beans.CommandQuery; /** @@ -55,7 +54,7 @@ public interface CommandService extends JAXRSService { * @return list of all commands. */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) PagedResult search(@BeanParam CommandQuery query); /** @@ -68,7 +67,7 @@ public interface CommandService extends JAXRSService { @Schema(type = "string")) @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) CommandTO read(@PathParam("key") String key); /** @@ -81,7 +80,7 @@ public interface CommandService extends JAXRSService { @Schema(type = "string")) @POST @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) CommandOutput run(CommandTO command); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DelegationService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DelegationService.java index 33e76c541bc..583aa6f6d96 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DelegationService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DelegationService.java @@ -59,7 +59,7 @@ public interface DelegationService extends JAXRSService { * @return list of all delegations. */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -70,7 +70,7 @@ public interface DelegationService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) DelegationTO read(@NotNull @PathParam("key") String key); /** @@ -89,8 +89,8 @@ public interface DelegationService extends JAXRSService { @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull DelegationTO delegationTO); /** @@ -104,8 +104,8 @@ public interface DelegationService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull DelegationTO delegationTO); /** @@ -117,6 +117,6 @@ public interface DelegationService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DynRealmService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DynRealmService.java index c69c901569c..3836e4f6488 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DynRealmService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/DynRealmService.java @@ -59,7 +59,7 @@ public interface DynRealmService extends JAXRSService { * @return list of all dynamic realms. */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -70,7 +70,7 @@ public interface DynRealmService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) DynRealmTO read(@NotNull @PathParam("key") String key); /** @@ -89,8 +89,8 @@ public interface DynRealmService extends JAXRSService { @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull DynRealmTO dynDynRealmTO); /** @@ -104,8 +104,8 @@ public interface DynRealmService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull DynRealmTO dynDynRealmTO); /** @@ -117,7 +117,7 @@ public interface DynRealmService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ExecutableService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ExecutableService.java index d650c85ad41..2f096c1f2f2 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ExecutableService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ExecutableService.java @@ -52,7 +52,7 @@ public interface ExecutableService extends JAXRSService { */ @GET @Path("{key}/executions") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) PagedResult listExecutions(@BeanParam ExecQuery query); /** @@ -63,7 +63,7 @@ public interface ExecutableService extends JAXRSService { */ @GET @Path("executions/recent") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List listRecentExecutions(@Min(1) @QueryParam(JAXRSService.PARAM_MAX) @DefaultValue("25") int max); /** @@ -75,7 +75,7 @@ public interface ExecutableService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("executions/{executionKey}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void deleteExecution(@NotNull @PathParam("executionKey") String executionKey); /** @@ -100,7 +100,7 @@ public interface ExecutableService extends JAXRSService { */ @POST @Path("{key}/execute") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) ExecTO execute(@BeanParam ExecSpecs specs); /** @@ -111,7 +111,7 @@ public interface ExecutableService extends JAXRSService { */ @GET @Path("jobs/{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) JobTO getJob(@PathParam("key") String key); /** @@ -121,7 +121,7 @@ public interface ExecutableService extends JAXRSService { */ @GET @Path("jobs") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List listJobs(); /** diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/FIQLQueryService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/FIQLQueryService.java index 02b7c1f2673..f3097f5a85e 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/FIQLQueryService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/FIQLQueryService.java @@ -61,7 +61,7 @@ public interface FIQLQueryService extends JAXRSService { * @return list of all FIQL queries for the calling user, matching the given target if provided */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(@QueryParam("target") String target); /** @@ -72,7 +72,7 @@ public interface FIQLQueryService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) FIQLQueryTO read(@NotNull @PathParam("key") String key); /** @@ -91,8 +91,8 @@ public interface FIQLQueryService extends JAXRSService { @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull FIQLQueryTO fiqlQueryTO); /** @@ -106,8 +106,8 @@ public interface FIQLQueryService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull FIQLQueryTO fiqlQueryTO); /** @@ -119,6 +119,6 @@ public interface FIQLQueryService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/GroupService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/GroupService.java index 3e889b2e5d6..3c14c2459cf 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/GroupService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/GroupService.java @@ -108,8 +108,8 @@ public interface GroupService extends AnyService { description = "Allows the server to inform the " + "client about the fact that a specified preference was applied") })) @POST - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) Response create(@NotNull GroupCR createReq); /** @@ -151,8 +151,8 @@ public interface GroupService extends AnyService { + " date of the entity") }) @PATCH @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) Response update(@NotNull GroupUR updateReq); /** @@ -162,7 +162,7 @@ public interface GroupService extends AnyService { */ @GET @Path("own") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List own(); /** @@ -174,7 +174,7 @@ public interface GroupService extends AnyService { */ @POST @Path("{key}/members/{action}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) ExecTO provisionMembers( @NotNull @PathParam("key") String key, @NotNull @PathParam("action") ProvisionAction action); diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ImplementationService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ImplementationService.java index 4706b49c3bc..2f2e61b3c17 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ImplementationService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ImplementationService.java @@ -37,7 +37,6 @@ import jakarta.ws.rs.core.Response; import java.util.List; import org.apache.syncope.common.lib.to.ImplementationTO; -import org.apache.syncope.common.rest.api.RESTHeaders; /** * REST operations for implementations. @@ -57,7 +56,7 @@ public interface ImplementationService extends JAXRSService { */ @GET @Path("{type}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(@NotNull @PathParam("type") String type); /** @@ -69,7 +68,7 @@ public interface ImplementationService extends JAXRSService { */ @GET @Path("{type}/{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) ImplementationTO read(@NotNull @PathParam("type") String type, @NotNull @PathParam("key") String key); /** @@ -84,8 +83,8 @@ public interface ImplementationService extends JAXRSService { @Schema(type = "string")) @POST @Path("{type}/{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull ImplementationTO implementationTO); /** @@ -100,8 +99,8 @@ public interface ImplementationService extends JAXRSService { @Schema(type = "string")) @PUT @Path("{type}/{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response update(@NotNull ImplementationTO implementationTO); /** @@ -113,6 +112,6 @@ public interface ImplementationService extends JAXRSService { */ @DELETE @Path("{type}/{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) Response delete(@NotNull @PathParam("type") String type, @NotNull @PathParam("key") String key); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/MailTemplateService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/MailTemplateService.java index ad282b09475..57386a341f1 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/MailTemplateService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/MailTemplateService.java @@ -59,7 +59,7 @@ public interface MailTemplateService extends JAXRSService { * @return list of all mail templates. */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -78,8 +78,8 @@ public interface MailTemplateService extends JAXRSService { @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull MailTemplateTO mailTemplateTO); /** @@ -90,7 +90,7 @@ public interface MailTemplateService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) MailTemplateTO read(@NotNull @PathParam("key") String key); /** @@ -102,7 +102,7 @@ public interface MailTemplateService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); /** @@ -129,7 +129,7 @@ Response getFormat( @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}/{format}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void setFormat( @NotNull @PathParam("key") String key, @NotNull @PathParam("format") MailTemplateFormat format, @@ -145,7 +145,7 @@ void setFormat( @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}/{format}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void removeFormat( @NotNull @PathParam("key") String key, @NotNull @PathParam("format") MailTemplateFormat format); diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java index cb85723fd7b..3af1ba97279 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/NotificationService.java @@ -64,7 +64,7 @@ public interface NotificationService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) NotificationTO read(@NotNull @PathParam("key") String key); /** @@ -73,7 +73,7 @@ public interface NotificationService extends JAXRSService { * @return list of all notifications. */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -92,8 +92,8 @@ public interface NotificationService extends JAXRSService { @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull NotificationTO notificationTO); /** @@ -107,8 +107,8 @@ public interface NotificationService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull NotificationTO notificationTO); /** @@ -120,7 +120,7 @@ public interface NotificationService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); /** @@ -130,7 +130,7 @@ public interface NotificationService extends JAXRSService { */ @GET @Path("job") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) JobTO getJob(); /** @@ -142,6 +142,6 @@ public interface NotificationService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @POST @Path("job") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void actionJob(@QueryParam("action") JobAction action); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java index 2adb806ac39..f48d4616343 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java @@ -64,7 +64,7 @@ public interface PolicyService extends JAXRSService { */ @GET @Path("{type}/{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) T read(@NotNull @PathParam("type") PolicyType type, @NotNull @PathParam("key") String key); /** @@ -76,7 +76,7 @@ public interface PolicyService extends JAXRSService { */ @GET @Path("{type}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(@NotNull @PathParam("type") PolicyType type); /** @@ -97,8 +97,8 @@ public interface PolicyService extends JAXRSService { description = "URL of the entity created") })) @POST @Path("{type}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull @PathParam("type") PolicyType type, @NotNull PolicyTO policyTO); /** @@ -113,8 +113,8 @@ public interface PolicyService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{type}/{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull @PathParam("type") PolicyType type, @NotNull PolicyTO policyTO); /** @@ -127,7 +127,7 @@ public interface PolicyService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{type}/{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("type") PolicyType type, @NotNull @PathParam("key") String key); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RealmService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RealmService.java index bda03ccb4cc..32deccf5930 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RealmService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RealmService.java @@ -64,7 +64,7 @@ public interface RealmService extends JAXRSService { * @return paged list of existing realms matching the given query */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) PagedResult search(@BeanParam RealmQuery query); /** @@ -103,8 +103,8 @@ public interface RealmService extends JAXRSService { + "client about the fact that a specified preference was applied") })) @POST @Path("{parentPath:.*}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull @PathParam("parentPath") String parentPath, @NotNull RealmTO realmTO); /** @@ -138,8 +138,8 @@ public interface RealmService extends JAXRSService { + "client about the fact that a specified preference was applied")) }) @PUT @Path("{fullPath:.*}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response update(@NotNull RealmTO realmTO); /** @@ -171,6 +171,6 @@ public interface RealmService extends JAXRSService { + "client about the fact that a specified preference was applied")) }) @DELETE @Path("{fullPath:.*}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) Response delete(@NotNull @PathParam("fullPath") String fullPath); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RelationshipTypeService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RelationshipTypeService.java index 3678e7e8aca..e09d80db2d9 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RelationshipTypeService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RelationshipTypeService.java @@ -59,7 +59,7 @@ public interface RelationshipTypeService extends JAXRSService { * @return list of all relationshipTypes. */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -70,7 +70,7 @@ public interface RelationshipTypeService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) RelationshipTypeTO read(@NotNull @PathParam("key") String key); /** @@ -89,8 +89,8 @@ public interface RelationshipTypeService extends JAXRSService { @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull RelationshipTypeTO relationshipTypeTO); /** @@ -104,8 +104,8 @@ public interface RelationshipTypeService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull RelationshipTypeTO relationshipTypeTO); /** @@ -117,6 +117,6 @@ public interface RelationshipTypeService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java index 0865e86886d..9e31e7f44ea 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/ReportService.java @@ -61,7 +61,7 @@ public interface ReportService extends ExecutableService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) ReportTO read(@NotNull @PathParam("key") String key); /** @@ -70,7 +70,7 @@ public interface ReportService extends ExecutableService { * @return paged list of existing reports matching the given query */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -89,8 +89,8 @@ public interface ReportService extends ExecutableService { @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull ReportTO reportTO); /** @@ -104,8 +104,8 @@ public interface ReportService extends ExecutableService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull ReportTO reportTO); /** @@ -117,7 +117,7 @@ public interface ReportService extends ExecutableService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); /** @@ -128,6 +128,6 @@ public interface ReportService extends ExecutableService { */ @GET @Path("executions/{executionKey}/stream") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) Response exportExecutionResult(@NotNull @PathParam("executionKey") String executionKey); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RoleService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RoleService.java index a421a945b4f..48c56adaf8a 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RoleService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/RoleService.java @@ -60,7 +60,7 @@ public interface RoleService extends JAXRSService { * @return list of all roles. */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -71,7 +71,7 @@ public interface RoleService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) RoleTO read(@NotNull @PathParam("key") String key); /** @@ -90,8 +90,8 @@ public interface RoleService extends JAXRSService { @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull RoleTO roleTO); /** @@ -105,8 +105,8 @@ public interface RoleService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull RoleTO roleTO); /** @@ -118,7 +118,7 @@ public interface RoleService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); /** @@ -143,7 +143,7 @@ public interface RoleService extends JAXRSService { @PUT @Path("{key}/anyLayout") @Consumes({ MediaType.APPLICATION_JSON }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void setAnyLayout(@NotNull @PathParam("key") String key, InputStream anyLayoutIn); /** @@ -155,6 +155,6 @@ public interface RoleService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}/anyLayout") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void removeAnyLayout(@NotNull @PathParam("key") String key); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java index 3459c27c732..2fe1c545f1f 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java @@ -69,7 +69,7 @@ public interface SchemaService extends JAXRSService { */ @GET @Path("{type}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List search(@BeanParam SchemaQuery query); /** @@ -82,7 +82,7 @@ public interface SchemaService extends JAXRSService { */ @GET @Path("{type}/{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) T read( @NotNull @PathParam("type") SchemaType type, @NotNull @PathParam("key") String key); @@ -104,8 +104,8 @@ T read( description = "URL of the entity created") })) @POST @Path("{type}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull @PathParam("type") SchemaType type, @NotNull SchemaTO schemaTO); /** @@ -120,8 +120,8 @@ T read( @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{type}/{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull @PathParam("type") SchemaType type, @NotNull SchemaTO schemaTO); /** @@ -134,18 +134,18 @@ T read( @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{type}/{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("type") SchemaType type, @NotNull @PathParam("key") String key); @POST @Path("PLAIN/any/{key}/dropdownValues") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Attr getDropdownValues(@NotNull @PathParam("key") String key, @NotNull AnyTO anyTO); @POST @Path("PLAIN/realm/{key}/dropdownValues") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Attr getDropdownValues(@NotNull @PathParam("key") String key, @NotNull RealmTO realmTO); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java index 71842be7c05..deda61560d7 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SecurityQuestionService.java @@ -59,7 +59,7 @@ public interface SecurityQuestionService extends JAXRSService { * @return list of all security questions */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -70,7 +70,7 @@ public interface SecurityQuestionService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) SecurityQuestionTO read(@NotNull @PathParam("key") String key); /** @@ -89,8 +89,8 @@ public interface SecurityQuestionService extends JAXRSService { @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull SecurityQuestionTO securityQuestionTO); /** @@ -104,8 +104,8 @@ public interface SecurityQuestionService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull SecurityQuestionTO securityQuestionTO); /** @@ -117,7 +117,7 @@ public interface SecurityQuestionService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); /** @@ -128,7 +128,7 @@ public interface SecurityQuestionService extends JAXRSService { */ @GET @Path("byUser/{username}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) SecurityQuestionTO readByUser(@NotNull @PathParam("username") String username); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java index dabecbc65d7..c43d5e34e77 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SyncopeService.java @@ -122,7 +122,7 @@ public interface SyncopeService extends JAXRSService { */ @POST @Path("assignableGroups/{realm:.*}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) PagedResult searchAssignableGroups( @NotNull @PathParam("realm") String realm, @QueryParam("term") String term, @@ -137,7 +137,7 @@ PagedResult searchAssignableGroups( */ @GET @Path("userTypeExtension/group/{groupName}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) TypeExtensionTO readUserGroupTypeExtension(@NotNull @PathParam("groupName") String groupName); /** @@ -148,7 +148,7 @@ PagedResult searchAssignableGroups( */ @GET @Path("userTypeExtension/relationshipType/{relationshipType}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) TypeExtensionTO readUserRelationshipTypeExtension(@NotNull @PathParam("relationshipType") String relationshipType); /** diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java index 5edca62132a..86136c09bcc 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java @@ -76,7 +76,7 @@ public interface TaskService extends ExecutableService { */ @GET @Path("{type}/{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) T read( @NotNull @PathParam("type") TaskType type, @NotNull @PathParam("key") String key, @@ -91,7 +91,7 @@ T read( */ @GET @Path("{type}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) PagedResult search(@BeanParam TaskQuery query); /** @@ -112,8 +112,8 @@ T read( description = "URL of the entity created") })) @POST @Path("{type}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(@NotNull @PathParam("type") TaskType type, @NotNull SchedTaskTO taskTO); /** @@ -128,8 +128,8 @@ T read( @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{type}/{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull @PathParam("type") TaskType type, @NotNull SchedTaskTO taskTO); /** @@ -142,7 +142,7 @@ T read( @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{type}/{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("type") TaskType type, @NotNull @PathParam("key") String key); /** @@ -159,7 +159,7 @@ T read( @ApiResponse(responseCode = "412", description = "At least one matching condition must be specified") }) @DELETE @Path("PROPAGATION/purge") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) Response purgePropagations( @QueryParam("since") OffsetDateTime since, @QueryParam("statuses") List statuses, @@ -174,7 +174,7 @@ Response purgePropagations( */ @GET @Path("MACRO/{key}/form") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) SyncopeForm getMacroTaskForm(@NotNull @PathParam("key") String key, @NotNull @QueryParam("locale") String locale); /** @@ -186,7 +186,7 @@ Response purgePropagations( */ @POST @Path("MACRO/{key}/execute") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) ExecTO execute(@BeanParam ExecSpecs specs, SyncopeForm macroTaskForm); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java index f1705c24d66..6f0e3c5f7de 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserSelfService.java @@ -78,7 +78,7 @@ public interface UserSelfService extends JAXRSService { description = "List of entitlements owned by the calling user") })) @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) Response read(); /** @@ -110,8 +110,8 @@ public interface UserSelfService extends JAXRSService { description = "Allows the server to inform the " + "client about the fact that a specified preference was applied") })) @POST - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) Response create(@NotNull UserCR createReq); /** @@ -143,8 +143,8 @@ public interface UserSelfService extends JAXRSService { + "client about the fact that a specified preference was applied")) }) @PATCH @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) Response update(@NotNull UserUR updateReq); /** @@ -176,8 +176,8 @@ public interface UserSelfService extends JAXRSService { + "client about the fact that a specified preference was applied")) }) @PUT @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) Response update(@NotNull UserTO user); /** @@ -209,8 +209,8 @@ public interface UserSelfService extends JAXRSService { + "client about the fact that a specified preference was applied")) }) @POST @Path("{key}/status") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) Response status(@NotNull StatusR statusR); /** @@ -222,7 +222,7 @@ public interface UserSelfService extends JAXRSService { @SecurityRequirement(name = "BasicAuthentication"), @SecurityRequirement(name = "Bearer") }) @DELETE - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) Response delete(); /** @@ -237,8 +237,8 @@ public interface UserSelfService extends JAXRSService { @SecurityRequirement(name = "Bearer") }) @POST @Path("mustChangePassword") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) Response mustChangePassword(@NotNull PasswordPatch password); /** @@ -253,8 +253,8 @@ public interface UserSelfService extends JAXRSService { @SecurityRequirement(name = "Bearer") }) @POST @Path("compliance") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) void compliance(@NotNull ComplianceQuery query); /** @@ -269,7 +269,7 @@ public interface UserSelfService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @POST @Path("requestPasswordReset") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void requestPasswordReset(@NotNull @QueryParam("username") String username, String securityAnswer); /** @@ -285,6 +285,6 @@ public interface UserSelfService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @POST @Path("confirmPasswordReset") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void confirmPasswordReset(@NotNull @QueryParam("token") String token, String password); } diff --git a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java index 913b17acd97..f7cbc3bd6f1 100644 --- a/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java +++ b/common/idrepo/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserService.java @@ -105,8 +105,8 @@ public interface UserService extends AnyService { description = "Allows the server to inform the " + "client about the fact that a specified preference was applied") })) @POST - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) Response create(@NotNull UserCR createReq); /** @@ -148,8 +148,8 @@ public interface UserService extends AnyService { + " date of the entity") }) @PATCH @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) Response update(@NotNull UserUR updateReq); /** @@ -192,8 +192,8 @@ public interface UserService extends AnyService { + " date of the entity") }) @POST @Path("{key}/status") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) Response status(@NotNull StatusR updateReq); /** @@ -208,6 +208,6 @@ public interface UserService extends AnyService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @POST @Path("verifySecurityAnswer") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void verifySecurityAnswer(@NotNull @QueryParam("username") String username, String securityAnswer); } diff --git a/core/idrepo/rest-cxf/pom.xml b/core/idrepo/rest-cxf/pom.xml index cfedee4151d..ceb08e94864 100644 --- a/core/idrepo/rest-cxf/pom.xml +++ b/core/idrepo/rest-cxf/pom.xml @@ -53,14 +53,6 @@ under the License. com.fasterxml.jackson.jakarta.rs jackson-jakarta-rs-json-provider - - com.fasterxml.jackson.jakarta.rs - jackson-jakarta-rs-xml-provider - - - com.fasterxml.jackson.jakarta.rs - jackson-jakarta-rs-yaml-provider - jakarta.xml.ws diff --git a/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/IdRepoRESTCXFContext.java b/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/IdRepoRESTCXFContext.java index ed422f422f2..594c346ffdd 100644 --- a/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/IdRepoRESTCXFContext.java +++ b/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/IdRepoRESTCXFContext.java @@ -19,8 +19,6 @@ package org.apache.syncope.core.rest.cxf; import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; -import com.fasterxml.jackson.jakarta.rs.xml.JacksonXMLProvider; -import com.fasterxml.jackson.jakarta.rs.yaml.JacksonYAMLProvider; import io.swagger.v3.oas.models.security.SecurityScheme; import jakarta.validation.Validator; import java.util.HashMap; @@ -44,8 +42,6 @@ import org.apache.cxf.transport.common.gzip.GZIPOutInterceptor; import org.apache.cxf.validation.BeanValidationProvider; import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper; -import org.apache.syncope.common.lib.jackson.SyncopeXmlMapper; -import org.apache.syncope.common.lib.jackson.SyncopeYAMLMapper; import org.apache.syncope.common.lib.search.SyncopeFiqlParser; import org.apache.syncope.common.rest.api.DateParamConverterProvider; import org.apache.syncope.common.rest.api.service.AccessTokenService; @@ -169,18 +165,6 @@ public JacksonJsonProvider jsonProvider() { return new JacksonJsonProvider(new SyncopeJsonMapper()); } - @ConditionalOnMissingBean - @Bean - public JacksonXMLProvider xmlProvider() { - return new JacksonXMLProvider(new SyncopeXmlMapper()); - } - - @ConditionalOnMissingBean - @Bean - public JacksonYAMLProvider yamlProvider() { - return new JacksonYAMLProvider(new SyncopeYAMLMapper()); - } - @ConditionalOnMissingBean @Bean public MDCInInterceptor mdcInInterceptor() { @@ -292,8 +276,6 @@ public Server restContainer( final AddETagFilter addETagFilter, final AddDomainFilter addDomainFilter, final ContextProvider searchContextProvider, - final JacksonYAMLProvider yamlProvider, - final JacksonXMLProvider xmlProvider, final JacksonJsonProvider jsonProvider, final DateParamConverterProvider dateParamConverterProvider, final MDCInInterceptor mdcInInterceptor, @@ -321,8 +303,6 @@ public Server restContainer( restContainer.setProviders(List.of( dateParamConverterProvider, jsonProvider, - xmlProvider, - yamlProvider, restServiceExceptionMapper, searchContextProvider, addDomainFilter, diff --git a/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/SyncopeOpenApiCustomizer.java b/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/SyncopeOpenApiCustomizer.java index edd778bae8f..9c1850e23d8 100644 --- a/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/SyncopeOpenApiCustomizer.java +++ b/core/idrepo/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/SyncopeOpenApiCustomizer.java @@ -164,12 +164,6 @@ protected void customizeResponses(final Operation operation, final OperationReso content.addMediaType( jakarta.ws.rs.core.MediaType.APPLICATION_JSON, new MediaType().schema(errorSchema)); - content.addMediaType( - RESTHeaders.APPLICATION_YAML, - new MediaType().schema(errorSchema)); - content.addMediaType( - jakarta.ws.rs.core.MediaType.APPLICATION_XML, - new MediaType().schema(errorSchema)); responses.addApiResponse("400", new ApiResponse(). description("An error occurred; HTTP status code can vary depending on the actual error: " diff --git a/core/idrepo/rest-cxf/src/test/java/org/apache/syncope/core/rest/cxf/service/AnyObjectServiceTest.java b/core/idrepo/rest-cxf/src/test/java/org/apache/syncope/core/rest/cxf/service/AnyObjectServiceTest.java index 055d0a25a35..cdfb89bc04c 100644 --- a/core/idrepo/rest-cxf/src/test/java/org/apache/syncope/core/rest/cxf/service/AnyObjectServiceTest.java +++ b/core/idrepo/rest-cxf/src/test/java/org/apache/syncope/core/rest/cxf/service/AnyObjectServiceTest.java @@ -30,8 +30,6 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; -import com.fasterxml.jackson.jakarta.rs.xml.JacksonXMLProvider; -import com.fasterxml.jackson.jakarta.rs.yaml.JacksonYAMLProvider; import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Request; import jakarta.ws.rs.core.Response; @@ -60,8 +58,6 @@ import org.apache.syncope.common.lib.Attr; import org.apache.syncope.common.lib.EntityTOUtils; import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper; -import org.apache.syncope.common.lib.jackson.SyncopeXmlMapper; -import org.apache.syncope.common.lib.jackson.SyncopeYAMLMapper; import org.apache.syncope.common.lib.request.AnyObjectCR; import org.apache.syncope.common.lib.to.AnyObjectTO; import org.apache.syncope.common.lib.to.PagedResult; @@ -98,12 +94,6 @@ public class AnyObjectServiceTest { @Autowired private JacksonJsonProvider jsonProvider; - @Autowired - private JacksonXMLProvider xmlProvider; - - @Autowired - private JacksonYAMLProvider yamlProvider; - @Autowired private RestServiceExceptionMapper exceptionMapper; @@ -193,7 +183,7 @@ public void setup() { sf.setInInterceptors(List.of(gzipInInterceptor, validationInInterceptor)); sf.setOutInterceptors(List.of(gzipOutInterceptor)); - sf.setProviders(List.of(dateParamConverterProvider, jsonProvider, xmlProvider, yamlProvider, + sf.setProviders(List.of(dateParamConverterProvider, jsonProvider, exceptionMapper, searchContextProvider, addETagFilter)); SERVER = sf.create(); @@ -204,22 +194,11 @@ public void setup() { private WebClient client(final MediaType mediaType) { WebClient client = WebClient.create(LOCAL_ADDRESS, List.of( - dateParamConverterProvider, jsonProvider, xmlProvider, yamlProvider)); + dateParamConverterProvider, jsonProvider)); WebClient.getConfig(client).getRequestContext().put(LocalConduit.DIRECT_DISPATCH, Boolean.TRUE); return client.accept(mediaType).type(mediaType).path("anyObjects"); } - private InputStream list(final MediaType mediaType) { - Response response = client(mediaType). - query("fiql", "$type==PRINTER"). - query("page", "1"). - query("size", "10"). - get(); - assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); - - return (InputStream) response.getEntity(); - } - private void checkList(final PagedResult list) { assertEquals(2, list.getTotalCount()); assertEquals(2, list.getResult().size()); @@ -233,58 +212,31 @@ private void checkList(final PagedResult list) { } @Test - public void jsonList() throws IOException { - InputStream in = list(MediaType.APPLICATION_JSON_TYPE); - - PagedResult list = new SyncopeJsonMapper(). - readValue(IOUtils.toString(in), new TypeReference<>() { - }); - checkList(list); - } + public void list() throws IOException { + Response response = client(MediaType.APPLICATION_JSON_TYPE). + query("fiql", "$type==PRINTER"). + query("page", "1"). + query("size", "10"). + get(); + assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); - @Test - public void xmlList() throws IOException { - InputStream in = list(MediaType.APPLICATION_XML_TYPE); + InputStream in = (InputStream) response.getEntity(); - PagedResult list = new SyncopeXmlMapper(). + PagedResult list = new SyncopeJsonMapper(). readValue(IOUtils.toString(in), new TypeReference<>() { }); checkList(list); } @Test - public void yamlList() throws IOException { - InputStream in = list(RESTHeaders.APPLICATION_YAML_TYPE); - - PagedResult list = new SyncopeYAMLMapper(). - readValue(IOUtils.toString(in), new TypeReference<>() { - }); - checkList(list); - } - - private void create(final MediaType mediaType) { + public void create() { AnyObjectCR newPrinter = new AnyObjectCR(); newPrinter.setName("newPrinter"); newPrinter.setType("PRINTER"); newPrinter.getPlainAttrs().add(new Attr.Builder("location").value("new").build()); - Response response = client(mediaType).post(newPrinter); + Response response = client(MediaType.APPLICATION_JSON_TYPE).post(newPrinter); assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus()); assertNotNull(response.getHeaderString(RESTHeaders.RESOURCE_KEY)); } - - @Test - public void jsonCreate() { - create(MediaType.APPLICATION_JSON_TYPE); - } - - @Test - public void xmlCreate() { - create(MediaType.APPLICATION_XML_TYPE); - } - - @Test - public void yamlCreate() { - create(RESTHeaders.APPLICATION_YAML_TYPE); - } } diff --git a/core/idrepo/rest-cxf/src/test/java/org/apache/syncope/core/rest/cxf/service/IdRepoRESTCXFTestContext.java b/core/idrepo/rest-cxf/src/test/java/org/apache/syncope/core/rest/cxf/service/IdRepoRESTCXFTestContext.java index 33cedde95ae..361f0673dd3 100644 --- a/core/idrepo/rest-cxf/src/test/java/org/apache/syncope/core/rest/cxf/service/IdRepoRESTCXFTestContext.java +++ b/core/idrepo/rest-cxf/src/test/java/org/apache/syncope/core/rest/cxf/service/IdRepoRESTCXFTestContext.java @@ -19,16 +19,12 @@ package org.apache.syncope.core.rest.cxf.service; import com.fasterxml.jackson.jakarta.rs.json.JacksonJsonProvider; -import com.fasterxml.jackson.jakarta.rs.xml.JacksonXMLProvider; -import com.fasterxml.jackson.jakarta.rs.yaml.JacksonYAMLProvider; import org.apache.cxf.jaxrs.ext.search.SearchContextProvider; import org.apache.cxf.jaxrs.validation.JAXRSBeanValidationInInterceptor; import org.apache.cxf.transport.common.gzip.GZIPInInterceptor; import org.apache.cxf.transport.common.gzip.GZIPOutInterceptor; import org.apache.cxf.validation.BeanValidationProvider; import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper; -import org.apache.syncope.common.lib.jackson.SyncopeXmlMapper; -import org.apache.syncope.common.lib.jackson.SyncopeYAMLMapper; import org.apache.syncope.common.rest.api.DateParamConverterProvider; import org.apache.syncope.core.rest.cxf.AddETagFilter; import org.apache.syncope.core.rest.cxf.RestServiceExceptionMapper; @@ -48,21 +44,11 @@ public DateParamConverterProvider dateParamConverterProvider() { return new DateParamConverterProvider(); } - @Bean - public JacksonXMLProvider xmlProvider() { - return new JacksonXMLProvider(new SyncopeXmlMapper()); - } - @Bean public JacksonJsonProvider jsonProvider() { return new JacksonJsonProvider(new SyncopeJsonMapper()); } - @Bean - public JacksonYAMLProvider yamlProvider() { - return new JacksonYAMLProvider(new SyncopeYAMLMapper()); - } - @Bean public BeanValidationProvider validationProvider() { return new BeanValidationProvider(); diff --git a/ext/flowable/common-lib/src/test/java/org/apache/syncope/common/lib/to/JSONTest.java b/ext/flowable/common-lib/src/test/java/org/apache/syncope/common/lib/to/JSONTest.java deleted file mode 100644 index bd8a292a999..00000000000 --- a/ext/flowable/common-lib/src/test/java/org/apache/syncope/common/lib/to/JSONTest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.common.lib.to; - -import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper; - -public class JSONTest extends SerializationTest { - - private static final ObjectMapper OBJECT_MAPPER = new SyncopeJsonMapper(); - - @Override - protected ObjectMapper objectMapper() { - return OBJECT_MAPPER; - } -} diff --git a/ext/flowable/common-lib/src/test/java/org/apache/syncope/common/lib/to/SerializationTest.java b/ext/flowable/common-lib/src/test/java/org/apache/syncope/common/lib/to/SerializationTest.java index d4f1fc8006d..b3596acad62 100644 --- a/ext/flowable/common-lib/src/test/java/org/apache/syncope/common/lib/to/SerializationTest.java +++ b/ext/flowable/common-lib/src/test/java/org/apache/syncope/common/lib/to/SerializationTest.java @@ -21,7 +21,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.json.JsonMapper; import java.io.IOException; import java.io.StringWriter; import java.util.Date; @@ -30,13 +30,14 @@ import org.apache.syncope.common.lib.form.FormProperty; import org.apache.syncope.common.lib.form.FormPropertyType; import org.apache.syncope.common.lib.form.FormPropertyValue; +import org.apache.syncope.common.lib.jackson.SyncopeJsonMapper; import org.apache.syncope.common.lib.request.AttrPatch; import org.apache.syncope.common.lib.request.UserUR; import org.junit.jupiter.api.Test; -public abstract class SerializationTest { +public class SerializationTest { - protected abstract ObjectMapper objectMapper(); + private static final JsonMapper MAPPER = new SyncopeJsonMapper(); @Test public void userRequestForm() throws IOException { @@ -72,9 +73,9 @@ public void userRequestForm() throws IOException { original.setTotalCount(1); StringWriter writer = new StringWriter(); - objectMapper().writeValue(writer, original); + MAPPER.writeValue(writer, original); - PagedResult actual = objectMapper().readValue(writer.toString(), new TypeReference<>() { + PagedResult actual = MAPPER.readValue(writer.toString(), new TypeReference<>() { }); assertEquals(original, actual); } diff --git a/ext/flowable/common-lib/src/test/java/org/apache/syncope/common/lib/to/XMLTest.java b/ext/flowable/common-lib/src/test/java/org/apache/syncope/common/lib/to/XMLTest.java deleted file mode 100644 index 2a47b305e49..00000000000 --- a/ext/flowable/common-lib/src/test/java/org/apache/syncope/common/lib/to/XMLTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.common.lib.to; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.xml.XmlMapper; -import org.apache.syncope.common.lib.jackson.SyncopeXmlMapper; - -public class XMLTest extends SerializationTest { - - private static final XmlMapper XML_MAPPER = new SyncopeXmlMapper(); - - @Override - protected ObjectMapper objectMapper() { - return XML_MAPPER; - } -} diff --git a/ext/flowable/common-lib/src/test/java/org/apache/syncope/common/lib/to/YAMLTest.java b/ext/flowable/common-lib/src/test/java/org/apache/syncope/common/lib/to/YAMLTest.java deleted file mode 100644 index 8e97b42cd1f..00000000000 --- a/ext/flowable/common-lib/src/test/java/org/apache/syncope/common/lib/to/YAMLTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.syncope.common.lib.to; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; -import org.apache.syncope.common.lib.jackson.SyncopeYAMLMapper; - -public class YAMLTest extends SerializationTest { - - private static final YAMLMapper YAML_MAPPER = new SyncopeYAMLMapper(); - - @Override - protected ObjectMapper objectMapper() { - return YAML_MAPPER; - } -} diff --git a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/BpmnProcessService.java b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/BpmnProcessService.java index f9418fd63a8..afdf18e464a 100644 --- a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/BpmnProcessService.java +++ b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/BpmnProcessService.java @@ -54,7 +54,7 @@ public interface BpmnProcessService extends JAXRSService { * @return available BPMN processs */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -107,6 +107,6 @@ public interface BpmnProcessService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@NotNull @PathParam("key") String key); } diff --git a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserRequestService.java b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserRequestService.java index cb2b9c91bb6..7bfc4212dfe 100644 --- a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserRequestService.java +++ b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserRequestService.java @@ -65,7 +65,7 @@ public interface UserRequestService extends JAXRSService { * @return list of all running user requests */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) PagedResult listRequests(@BeanParam UserRequestQuery query); /** @@ -78,8 +78,8 @@ public interface UserRequestService extends JAXRSService { */ @POST @Path("start/{bpmnProcess}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) UserRequest startRequest( @NotNull @PathParam("bpmnProcess") String bpmnProcess, @QueryParam(JAXRSService.PARAM_USER) String user, @@ -95,7 +95,7 @@ UserRequest startRequest( @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{executionId}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void cancelRequest( @NotNull @PathParam("executionId") String executionId, @QueryParam("reason") String reason); @@ -109,7 +109,7 @@ void cancelRequest( */ @GET @Path("forms/{username}/{taskId}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) UserRequestForm getForm( @NotNull @PathParam("username") String username, @NotNull @PathParam("taskId") String taskId); @@ -122,7 +122,7 @@ UserRequestForm getForm( */ @GET @Path("forms") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) PagedResult listForms(@BeanParam UserRequestQuery query); /** @@ -133,7 +133,7 @@ UserRequestForm getForm( */ @POST @Path("forms/{taskId}/claim") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) UserRequestForm claimForm(@NotNull @PathParam("taskId") String taskId); /** @@ -144,7 +144,7 @@ UserRequestForm getForm( */ @POST @Path("forms/{taskId}/unclaim") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) UserRequestForm unclaimForm(@NotNull @PathParam("taskId") String taskId); /** @@ -177,7 +177,7 @@ UserRequestForm getForm( + "client about the fact that a specified preference was applied")) }) @POST @Path("forms") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) Response submitForm(@NotNull UserRequestForm form); } diff --git a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowTaskService.java b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowTaskService.java index 630c62c0843..c7e0ca9db30 100644 --- a/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowTaskService.java +++ b/ext/flowable/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/UserWorkflowTaskService.java @@ -36,7 +36,6 @@ import org.apache.syncope.common.lib.to.UserTO; import org.apache.syncope.common.lib.to.WorkflowTask; import org.apache.syncope.common.lib.to.WorkflowTaskExecInput; -import org.apache.syncope.common.rest.api.RESTHeaders; @Tag(name = "Flowable") @SecurityRequirements({ @@ -53,7 +52,7 @@ public interface UserWorkflowTaskService extends JAXRSService { */ @GET @Path("tasks/{userKey}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List getAvailableTasks(@NotNull @PathParam("userKey") String userKey); /** @@ -66,7 +65,7 @@ public interface UserWorkflowTaskService extends JAXRSService { @Schema(type = "string")) @POST @Path("tasks/{userKey}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) + @Consumes({ MediaType.APPLICATION_JSON }) UserTO executeNextTask(@NotNull WorkflowTaskExecInput workflowTaskExecInput); } diff --git a/ext/oidcc4ui/common-lib/src/main/java/org/apache/syncope/common/lib/oidc/OIDCLoginResponse.java b/ext/oidcc4ui/common-lib/src/main/java/org/apache/syncope/common/lib/oidc/OIDCLoginResponse.java index 4ba78e064e7..21c0326ae6b 100644 --- a/ext/oidcc4ui/common-lib/src/main/java/org/apache/syncope/common/lib/oidc/OIDCLoginResponse.java +++ b/ext/oidcc4ui/common-lib/src/main/java/org/apache/syncope/common/lib/oidc/OIDCLoginResponse.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.oidc; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.io.Serializable; import java.time.OffsetDateTime; import java.util.HashSet; @@ -89,8 +87,6 @@ public Optional getAttr(final String schema) { return attrs.stream().filter(attr -> attr.getSchema().equals(schema)).findFirst(); } - @JacksonXmlElementWrapper(localName = "attrs") - @JacksonXmlProperty(localName = "attr") public Set getAttrs() { return attrs; } diff --git a/ext/oidcc4ui/common-lib/src/main/java/org/apache/syncope/common/lib/to/OIDCC4UIProviderTO.java b/ext/oidcc4ui/common-lib/src/main/java/org/apache/syncope/common/lib/to/OIDCC4UIProviderTO.java index 33acb7a9ce2..57561fa9b8d 100644 --- a/ext/oidcc4ui/common-lib/src/main/java/org/apache/syncope/common/lib/to/OIDCC4UIProviderTO.java +++ b/ext/oidcc4ui/common-lib/src/main/java/org/apache/syncope/common/lib/to/OIDCC4UIProviderTO.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import jakarta.ws.rs.PathParam; import java.util.ArrayList; import java.util.List; @@ -145,8 +143,6 @@ public void setEndSessionEndpoint(final String endSessionEndpoint) { this.endSessionEndpoint = endSessionEndpoint; } - @JacksonXmlElementWrapper(localName = "scopes") - @JacksonXmlProperty(localName = "scope") public List getScopes() { return scopes; } @@ -191,8 +187,6 @@ public void setSelfRegUnmatching(final boolean selfRegUnmatching) { this.selfRegUnmatching = selfRegUnmatching; } - @JacksonXmlElementWrapper(localName = "actions") - @JacksonXmlProperty(localName = "action") public List getActions() { return actions; } diff --git a/ext/oidcc4ui/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCC4UIProviderService.java b/ext/oidcc4ui/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCC4UIProviderService.java index 0f1123d00f8..90f8f91844c 100644 --- a/ext/oidcc4ui/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCC4UIProviderService.java +++ b/ext/oidcc4ui/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCC4UIProviderService.java @@ -59,7 +59,7 @@ public interface OIDCC4UIProviderService extends JAXRSService { * @return list of all defined OIDC Providers */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -70,7 +70,7 @@ public interface OIDCC4UIProviderService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) OIDCC4UIProviderTO read(@PathParam("key") String key); /** @@ -89,8 +89,8 @@ public interface OIDCC4UIProviderService extends JAXRSService { @Schema(type = "string"), description = "URL of the entity created") })) @POST - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response create(OIDCC4UIProviderTO oidcProviderTO); /** @@ -110,8 +110,8 @@ public interface OIDCC4UIProviderService extends JAXRSService { description = "URL of the entity created") })) @POST @Path("fromDiscovery") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) Response createFromDiscovery(OIDCC4UIProviderTO oidcProviderTO); /** @@ -125,8 +125,8 @@ public interface OIDCC4UIProviderService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull OIDCC4UIProviderTO oidcProviderTO); /** @@ -138,6 +138,6 @@ public interface OIDCC4UIProviderService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@PathParam("key") String key); } diff --git a/ext/oidcc4ui/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCC4UIService.java b/ext/oidcc4ui/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCC4UIService.java index 43b994b4433..d56c5b42762 100644 --- a/ext/oidcc4ui/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCC4UIService.java +++ b/ext/oidcc4ui/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/OIDCC4UIService.java @@ -30,7 +30,6 @@ import org.apache.syncope.common.lib.oidc.OIDCConstants; import org.apache.syncope.common.lib.oidc.OIDCLoginResponse; import org.apache.syncope.common.lib.oidc.OIDCRequest; -import org.apache.syncope.common.rest.api.RESTHeaders; /** * REST operations for OpenID Connect Clients. @@ -52,7 +51,7 @@ public interface OIDCC4UIService extends JAXRSService { */ @POST @Path("loginRequest") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) OIDCRequest createLoginRequest( @QueryParam(OIDCConstants.REDIRECT_URI) String redirectURI, @QueryParam(OIDCConstants.OP) String op, @@ -69,7 +68,7 @@ OIDCRequest createLoginRequest( */ @POST @Path("login") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) OIDCLoginResponse login( @QueryParam(OIDCConstants.REDIRECT_URI) String redirectURI, @QueryParam("authorizationCode") String authorizationCode, @@ -83,7 +82,7 @@ OIDCLoginResponse login( */ @POST @Path("logout") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) OIDCRequest createLogoutRequest(@QueryParam(OIDCConstants.REDIRECT_URI) String redirectURI); /** @@ -94,7 +93,7 @@ OIDCLoginResponse login( */ @POST @Path("backChannelLogout") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void backChannelLogout( @QueryParam(OIDCConstants.LOGOUT_TOKEN) String logoutToken, @QueryParam(OIDCConstants.REDIRECT_URI) String redirectURI); diff --git a/ext/saml2sp4ui/common-lib/src/main/java/org/apache/syncope/common/lib/saml2/SAML2LoginResponse.java b/ext/saml2sp4ui/common-lib/src/main/java/org/apache/syncope/common/lib/saml2/SAML2LoginResponse.java index 75852143294..bdc19cd867f 100644 --- a/ext/saml2sp4ui/common-lib/src/main/java/org/apache/syncope/common/lib/saml2/SAML2LoginResponse.java +++ b/ext/saml2sp4ui/common-lib/src/main/java/org/apache/syncope/common/lib/saml2/SAML2LoginResponse.java @@ -19,8 +19,6 @@ package org.apache.syncope.common.lib.saml2; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import java.io.Serializable; import java.time.OffsetDateTime; import java.util.Date; @@ -107,8 +105,6 @@ public Optional getAttr(final String schema) { return attrs.stream().filter(attr -> attr.getSchema().equals(schema)).findFirst(); } - @JacksonXmlElementWrapper(localName = "attrs") - @JacksonXmlProperty(localName = "attr") public Set getAttrs() { return attrs; } diff --git a/ext/saml2sp4ui/common-lib/src/main/java/org/apache/syncope/common/lib/to/SAML2SP4UIIdPTO.java b/ext/saml2sp4ui/common-lib/src/main/java/org/apache/syncope/common/lib/to/SAML2SP4UIIdPTO.java index 239040cc2a0..7cdedcfeb81 100644 --- a/ext/saml2sp4ui/common-lib/src/main/java/org/apache/syncope/common/lib/to/SAML2SP4UIIdPTO.java +++ b/ext/saml2sp4ui/common-lib/src/main/java/org/apache/syncope/common/lib/to/SAML2SP4UIIdPTO.java @@ -18,8 +18,6 @@ */ package org.apache.syncope.common.lib.to; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import jakarta.ws.rs.PathParam; import java.util.ArrayList; import java.util.List; @@ -144,8 +142,6 @@ public void setUserTemplate(final UserTO userTemplate) { this.userTemplate = userTemplate; } - @JacksonXmlElementWrapper(localName = "actions") - @JacksonXmlProperty(localName = "action") public List getActions() { return actions; } diff --git a/ext/saml2sp4ui/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SP4UIIdPService.java b/ext/saml2sp4ui/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SP4UIIdPService.java index 632d8676864..8596b313d98 100644 --- a/ext/saml2sp4ui/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SP4UIIdPService.java +++ b/ext/saml2sp4ui/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SP4UIIdPService.java @@ -60,7 +60,7 @@ public interface SAML2SP4UIIdPService extends JAXRSService { * @return list of all defined SAML 2.0 Identity Providers */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) List list(); /** @@ -71,7 +71,7 @@ public interface SAML2SP4UIIdPService extends JAXRSService { */ @GET @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) SAML2SP4UIIdPTO read(@PathParam("key") String key); /** @@ -91,7 +91,7 @@ public interface SAML2SP4UIIdPService extends JAXRSService { description = "URL of the entity created") })) @POST @Consumes({ MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) Response importFromMetadata(@NotNull InputStream input); /** @@ -105,8 +105,8 @@ public interface SAML2SP4UIIdPService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT @Path("{key}") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void update(@NotNull SAML2SP4UIIdPTO saml2IdpTO); /** @@ -118,6 +118,6 @@ public interface SAML2SP4UIIdPService extends JAXRSService { @ApiResponse(responseCode = "204", description = "Operation was successful")) @DELETE @Path("{key}") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) void delete(@PathParam("key") String key); } diff --git a/ext/saml2sp4ui/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SP4UIService.java b/ext/saml2sp4ui/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SP4UIService.java index e80e7e74160..2ef4814e93e 100644 --- a/ext/saml2sp4ui/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SP4UIService.java +++ b/ext/saml2sp4ui/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SAML2SP4UIService.java @@ -35,7 +35,6 @@ import org.apache.syncope.common.lib.saml2.SAML2LoginResponse; import org.apache.syncope.common.lib.saml2.SAML2Request; import org.apache.syncope.common.lib.saml2.SAML2Response; -import org.apache.syncope.common.rest.api.RESTHeaders; /** * REST operations for the provided SAML 2.0 SP4UI Service Provider. @@ -69,7 +68,7 @@ public interface SAML2SP4UIService extends JAXRSService { */ @POST @Path("loginRequest") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) SAML2Request createLoginRequest( @QueryParam("spEntityID") String spEntityID, @QueryParam("urlContext") String urlContext, @@ -84,8 +83,8 @@ SAML2Request createLoginRequest( */ @POST @Path("loginResponse") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) SAML2LoginResponse validateLoginResponse(SAML2Response response); /** @@ -97,7 +96,7 @@ SAML2Request createLoginRequest( */ @POST @Path("logoutRequest") - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) SAML2Request createLogoutRequest( @QueryParam("spEntityID") String spEntityID, @QueryParam("urlContext") String urlContext); @@ -110,7 +109,7 @@ SAML2Request createLogoutRequest( @ApiResponse(responseCode = "204", description = "Operation was successful")) @POST @Path("logoutResponse") - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void validateLogoutResponse(SAML2Response response); } diff --git a/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java b/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java index dadf9f97988..b32a39a43d1 100644 --- a/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java +++ b/ext/scimv2/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SCIMConfService.java @@ -31,7 +31,6 @@ import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; import org.apache.syncope.common.lib.scim.SCIMConf; -import org.apache.syncope.common.rest.api.RESTHeaders; /** * REST operations for SCIM 2.0 configuration. @@ -49,7 +48,7 @@ public interface SCIMConfService extends JAXRSService { * @return SCIM configuration */ @GET - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Produces({ MediaType.APPLICATION_JSON }) SCIMConf get(); /** @@ -60,7 +59,7 @@ public interface SCIMConfService extends JAXRSService { @ApiResponses( @ApiResponse(responseCode = "204", description = "Operation was successful")) @PUT - @Consumes({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) - @Produces({ MediaType.APPLICATION_JSON, RESTHeaders.APPLICATION_YAML, MediaType.APPLICATION_XML }) + @Consumes({ MediaType.APPLICATION_JSON }) + @Produces({ MediaType.APPLICATION_JSON }) void set(@NotNull SCIMConf conf); } diff --git a/fit/core-reference/pom.xml b/fit/core-reference/pom.xml index de966b3aa67..cc0626500ba 100644 --- a/fit/core-reference/pom.xml +++ b/fit/core-reference/pom.xml @@ -286,7 +286,6 @@ under the License. true - ${jaxrs.content.type} ${obscureSecretKey} @@ -297,7 +296,6 @@ under the License. true - ${jaxrs.content.type} ${obscureSecretKey} @@ -1243,6 +1241,10 @@ under the License. jakarta.faces ${jakarta.faces.version} + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java index d3c7bf7b1ea..362a6a58987 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java @@ -24,8 +24,6 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.json.JsonMapper; -import com.fasterxml.jackson.dataformat.xml.XmlMapper; -import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import com.nimbusds.jose.JWSAlgorithm; import com.unboundid.ldap.sdk.AddRequest; import com.unboundid.ldap.sdk.Attribute; @@ -222,11 +220,7 @@ public void initialize(final ConfigurableApplicationContext ctx) { protected static final Logger LOG = LoggerFactory.getLogger(AbstractITCase.class); - protected static final JsonMapper JSON_MAPPER = JsonMapper.builder().findAndAddModules().build(); - - protected static final XmlMapper XML_MAPPER = XmlMapper.builder().findAndAddModules().build(); - - protected static final YAMLMapper YAML_MAPPER = YAMLMapper.builder().findAndAddModules().build(); + protected static final JsonMapper MAPPER = JsonMapper.builder().findAndAddModules().build(); protected static final String ADMIN_UNAME = "admin"; @@ -236,8 +230,6 @@ public void initialize(final ConfigurableApplicationContext ctx) { protected static final String BUILD_TOOLS_ADDRESS = "http://localhost:9080/syncope-fit-build-tools/cxf"; - protected static final String ENV_KEY_CONTENT_TYPE = "jaxrsContentType"; - protected static final String RESOURCE_NAME_WS1 = "ws-target-resource-1"; protected static final String RESOURCE_NAME_WS2 = "ws-target-resource-2"; @@ -498,7 +490,7 @@ public static void anonymousSetup() throws IOException { return null; } }, Objects::nonNull); - JsonNode beans = JSON_MAPPER.readTree(beansJSON); + JsonNode beans = MAPPER.readTree(beansJSON); JsonNode uwfAdapter = beans.findValues("uwfAdapter").getFirst(); IS_FLOWABLE_ENABLED = uwfAdapter.get("resource").asText().contains("Flowable"); @@ -516,11 +508,6 @@ public static void anonymousSetup() throws IOException { SyncopeClientFactoryBean masterCF = new SyncopeClientFactoryBean().setAddress(ADDRESS); SyncopeClientFactoryBean twoCF = new SyncopeClientFactoryBean().setAddress(ADDRESS).setDomain("Two"); - String envContentType = System.getProperty(ENV_KEY_CONTENT_TYPE); - if (StringUtils.isNotBlank(envContentType)) { - masterCF.setContentType(envContentType); - twoCF.setContentType(envContentType); - } SyncopeClient masterSC = masterCF.create(ADMIN_UNAME, ADMIN_PWD); ImplementationService masterIS = masterSC.getService(ImplementationService.class); TaskService masterTS = masterSC.getService(TaskService.class); @@ -554,12 +541,6 @@ public static void conf() { public static void restSetup() { CLIENT_FACTORY = new SyncopeClientFactoryBean().setAddress(ADDRESS); - String envContentType = System.getProperty(ENV_KEY_CONTENT_TYPE); - if (StringUtils.isNotBlank(envContentType)) { - CLIENT_FACTORY.setContentType(envContentType); - } - LOG.info("Performing IT with content type {}", CLIENT_FACTORY.getContentType().getMediaType()); - ADMIN_CLIENT = CLIENT_FACTORY.create(ADMIN_UNAME, ADMIN_PWD); SYNCOPE_SERVICE = ADMIN_CLIENT.getService(SyncopeService.class); @@ -621,7 +602,7 @@ protected static AttrPatch attrAddReplacePatch(final String schema, final String protected static T getObject(final URI location, final Class serviceClass, final Class resultClass) { WebClient webClient = WebClient.fromClient(WebClient.client(ADMIN_CLIENT.getService(serviceClass))); - webClient.accept(CLIENT_FACTORY.getContentType().getMediaType()).to(location.toASCIIString(), false); + webClient.accept(MediaType.APPLICATION_JSON).to(location.toASCIIString(), false); return webClient. header(RESTHeaders.DOMAIN, ADMIN_CLIENT.getDomain()). diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuditITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuditITCase.java index 6b335c7d816..36598d367cb 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuditITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AuditITCase.java @@ -259,7 +259,7 @@ public void findByConnector() throws JsonProcessingException { entries = query(query, MAX_WAIT_SECONDS); assertEquals(pre + 1, entries.size()); - ConnInstanceTO restore = JSON_MAPPER.readValue(entries.getFirst().getBefore(), ConnInstanceTO.class); + ConnInstanceTO restore = MAPPER.readValue(entries.getFirst().getBefore(), ConnInstanceTO.class); CONNECTOR_SERVICE.update(restore); ldapConn = CONNECTOR_SERVICE.read(connectorKey, null); diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BatchITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BatchITCase.java index 5aec509a82a..6d512635649 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BatchITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BatchITCase.java @@ -68,40 +68,40 @@ public class BatchITCase extends AbstractITCase { private static String requestBody(final String boundary) throws JsonProcessingException { List reqItems = new ArrayList<>(); - // 1. create user as YAML + // 1. create user UserCR userCR = UserITCase.getUniqueSample("batch@syncope.apache.org"); assertNotEquals("/odd", userCR.getRealm()); - String createUserPayload = YAML_MAPPER.writeValueAsString(userCR); + String createUserPayload = MAPPER.writeValueAsString(userCR); BatchRequestItem createUser = new BatchRequestItem(); createUser.setMethod(HttpMethod.POST); createUser.setRequestURI("/users"); createUser.setHeaders(new HashMap<>()); - createUser.getHeaders().put(HttpHeaders.ACCEPT, List.of(RESTHeaders.APPLICATION_YAML)); - createUser.getHeaders().put(HttpHeaders.CONTENT_TYPE, List.of(RESTHeaders.APPLICATION_YAML)); + createUser.getHeaders().put(HttpHeaders.ACCEPT, List.of(MediaType.APPLICATION_JSON)); + createUser.getHeaders().put(HttpHeaders.CONTENT_TYPE, List.of(MediaType.APPLICATION_JSON)); createUser.getHeaders().put(HttpHeaders.CONTENT_LENGTH, List.of(createUserPayload.length())); createUser.setContent(createUserPayload); reqItems.add(createUser); - // 2. create group as XML + // 2. create group GroupCR groupCR = GroupITCase.getBasicSample("batch"); - String createGroupPayload = XML_MAPPER.writeValueAsString(groupCR); + String createGroupPayload = MAPPER.writeValueAsString(groupCR); BatchRequestItem createGroup = new BatchRequestItem(); createGroup.setMethod(HttpMethod.POST); createGroup.setRequestURI("/groups"); createGroup.setHeaders(new HashMap<>()); - createGroup.getHeaders().put(HttpHeaders.ACCEPT, List.of(MediaType.APPLICATION_XML)); - createGroup.getHeaders().put(HttpHeaders.CONTENT_TYPE, List.of(MediaType.APPLICATION_XML)); + createGroup.getHeaders().put(HttpHeaders.ACCEPT, List.of(MediaType.APPLICATION_JSON)); + createGroup.getHeaders().put(HttpHeaders.CONTENT_TYPE, List.of(MediaType.APPLICATION_JSON)); createGroup.getHeaders().put(HttpHeaders.CONTENT_LENGTH, List.of(createGroupPayload.length())); createGroup.setContent(createGroupPayload); reqItems.add(createGroup); - // 3. update the user above as JSON, request for no user data being returned + // 3. update the user above, request for no user data being returned UserUR userUR = new UserUR(); userUR.setKey(userCR.getUsername()); userUR.setRealm(new StringReplacePatchItem.Builder().value("/odd").build()); - String updateUserPayload = JSON_MAPPER.writeValueAsString(userUR); + String updateUserPayload = MAPPER.writeValueAsString(userUR); BatchRequestItem updateUser = new BatchRequestItem(); updateUser.setMethod(HttpMethod.PATCH); @@ -126,7 +126,7 @@ private static String requestBody(final String boundary) throws JsonProcessingEx groupNotFound.setRequestURI("/groups/" + UUID.randomUUID()); reqItems.add(groupNotFound); - // 6, delete the group created above, expect deleted group as JSON + // 6, delete the group created above, expect deleted group BatchRequestItem deleteGroup = new BatchRequestItem(); deleteGroup.setMethod(HttpMethod.DELETE); deleteGroup.setRequestURI("/groups/" + groupCR.getName()); @@ -146,9 +146,9 @@ private static void check(final List resItems) throws IOExcep assertNotNull(resItems.getFirst().getHeaders().get(HttpHeaders.ETAG)); assertNotNull(resItems.getFirst().getHeaders().get(RESTHeaders.DOMAIN)); assertNotNull(resItems.getFirst().getHeaders().get(RESTHeaders.RESOURCE_KEY)); - assertEquals(RESTHeaders.APPLICATION_YAML, resItems.getFirst(). + assertEquals(MediaType.APPLICATION_JSON, resItems.getFirst(). getHeaders().get(HttpHeaders.CONTENT_TYPE).getFirst()); - ProvisioningResult user = YAML_MAPPER.readValue( + ProvisioningResult user = MAPPER.readValue( resItems.get(0).getContent(), new TypeReference<>() { }); assertNotNull(user.getEntity().getKey()); @@ -158,9 +158,9 @@ private static void check(final List resItems) throws IOExcep assertNotNull(resItems.get(1).getHeaders().get(HttpHeaders.ETAG)); assertNotNull(resItems.get(1).getHeaders().get(RESTHeaders.DOMAIN)); assertNotNull(resItems.get(1).getHeaders().get(RESTHeaders.RESOURCE_KEY)); - assertEquals(MediaType.APPLICATION_XML, resItems.get(1).getHeaders().get(HttpHeaders.CONTENT_TYPE).getFirst()); + assertEquals(MediaType.APPLICATION_JSON, resItems.get(1).getHeaders().get(HttpHeaders.CONTENT_TYPE).getFirst()); - ProvisioningResult group = XML_MAPPER.readValue( + ProvisioningResult group = MAPPER.readValue( resItems.get(1).getContent(), new TypeReference<>() { }); assertNotNull(group.getEntity().getKey()); @@ -182,7 +182,7 @@ private static void check(final List resItems) throws IOExcep assertEquals(Response.Status.OK.getStatusCode(), resItems.get(5).getStatus()); assertNotNull(resItems.get(5).getHeaders().get(RESTHeaders.DOMAIN)); assertEquals(MediaType.APPLICATION_JSON, resItems.get(5).getHeaders().get(HttpHeaders.CONTENT_TYPE).getFirst()); - group = JSON_MAPPER.readValue( + group = MAPPER.readValue( resItems.get(5).getContent(), new TypeReference<>() { }); assertNotNull(group); @@ -262,22 +262,22 @@ public void webClientAsync() throws IOException { private static BatchRequest batchRequest() { BatchRequest batchRequest = ADMIN_CLIENT.batch(); - // 1. create user as YAML + // 1. create user UserService batchUserService = batchRequest.getService(UserService.class); Client client = WebClient.client(batchUserService).reset(); - client.type(RESTHeaders.APPLICATION_YAML).accept(RESTHeaders.APPLICATION_YAML); + client.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON); UserCR userCR = UserITCase.getUniqueSample("batch@syncope.apache.org"); assertNotEquals("/odd", userCR.getRealm()); batchUserService.create(userCR); - // 2. create group as XML + // 2. create group GroupService batchGroupService = batchRequest.getService(GroupService.class); client = WebClient.client(batchGroupService).reset(); - client.type(MediaType.APPLICATION_XML).accept(MediaType.APPLICATION_XML); + client.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON); GroupCR groupCR = GroupITCase.getBasicSample("batch"); batchGroupService.create(groupCR); - // 3. update the user above as JSON, request for no user data being returned + // 3. update the user above, request for no user data being returned client = WebClient.client(batchUserService).reset(); client.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON); client.header(RESTHeaders.PREFER, Preference.RETURN_NO_CONTENT.toString()); @@ -294,7 +294,7 @@ private static BatchRequest batchRequest() { client.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON); batchGroupService.delete(UUID.randomUUID().toString()); - // 6, delete the group created above, expect deleted group as JSON + // 6, delete the group created above, expect deleted group batchGroupService.delete(groupCR.getName()); return batchRequest; diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BpmnProcessITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BpmnProcessITCase.java index ac83c8976e8..6e28f70c12d 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BpmnProcessITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/BpmnProcessITCase.java @@ -20,13 +20,10 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assumptions.assumeFalse; import static org.junit.jupiter.api.Assumptions.assumeTrue; import jakarta.ws.rs.core.Response; import java.io.IOException; -import org.apache.syncope.client.lib.SyncopeClientFactoryBean; import org.apache.syncope.common.lib.to.BpmnProcess; import org.apache.syncope.fit.AbstractITCase; import org.junit.jupiter.api.BeforeAll; @@ -39,7 +36,6 @@ public class BpmnProcessITCase extends AbstractITCase { @BeforeAll public static void findDefault() { - assumeFalse(CLIENT_FACTORY.getContentType() == SyncopeClientFactoryBean.ContentType.YAML); assumeTrue(IS_FLOWABLE_ENABLED); BPMN_PROCESS_SERVICE.list().stream(). @@ -50,15 +46,12 @@ public static void findDefault() { @BeforeEach public void check() { - assumeFalse(CLIENT_FACTORY.getContentType() == SyncopeClientFactoryBean.ContentType.YAML); assumeTrue(IS_FLOWABLE_ENABLED); } @Test public void exportUserWorkflowProcess() throws IOException { Response response = BPMN_PROCESS_SERVICE.get(USER_WORKFLOW_KEY); - assertTrue(response.getMediaType().toString(). - startsWith(CLIENT_FACTORY.getContentType().getMediaType().toString())); String definition = response.readEntity(String.class); assertNotNull(definition); assertFalse(definition.isEmpty()); diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/DynRealmITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/DynRealmITCase.java index 292955afae0..45a560198a0 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/DynRealmITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/DynRealmITCase.java @@ -81,7 +81,7 @@ private static ArrayNode fetchDynRealmsFromElasticsearch(final String userKey) t BodyHandlers.ofString()); assertEquals(Response.Status.OK.getStatusCode(), response.statusCode()); - return (ArrayNode) JSON_MAPPER.readTree(response.body()). + return (ArrayNode) MAPPER.readTree(response.body()). get("hits").get("hits").get(0).get("_source").get("dynRealms"); } diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/KeymasterITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/KeymasterITCase.java index cf30a5de4e6..c891ca0b321 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/KeymasterITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/KeymasterITCase.java @@ -343,16 +343,14 @@ public void domainUpdateAdminPassword() throws Exception { // 2. attempt to access with old pwd -> fail try { new SyncopeClientFactoryBean(). - setAddress(ADDRESS).setDomain(two.getKey()).setContentType(CLIENT_FACTORY.getContentType()). - create(ADMIN_UNAME, "password2").self(); + setAddress(ADDRESS).setDomain(two.getKey()).create(ADMIN_UNAME, "password2").self(); } catch (NotAuthorizedException e) { assertNotNull(e); } // 3. access with new pwd -> succeed new SyncopeClientFactoryBean(). - setAddress(ADDRESS).setDomain(two.getKey()).setContentType(CLIENT_FACTORY.getContentType()). - create(ADMIN_UNAME, "password3").self(); + setAddress(ADDRESS).setDomain(two.getKey()).create(ADMIN_UNAME, "password3").self(); } finally { domainOps.changeAdminPassword(two.getKey(), origPasswowrd, origCipherAlgo); } diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/LinkedAccountITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/LinkedAccountITCase.java index 02e1f2a74ef..6b083d47feb 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/LinkedAccountITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/LinkedAccountITCase.java @@ -477,7 +477,7 @@ public void pull() { WebClient webClient = WebClient.create(BUILD_TOOLS_ADDRESS + "/rest/users"). accept(MediaType.APPLICATION_JSON_TYPE).type(MediaType.APPLICATION_JSON_TYPE); - ObjectNode user = JSON_MAPPER.createObjectNode(); + ObjectNode user = MAPPER.createObjectNode(); user.put("username", "linkedaccount1"); user.put("password", "Password123"); user.put("firstName", "Pasquale"); @@ -489,7 +489,7 @@ public void pull() { String user1Key = StringUtils.substringAfterLast(response.getHeaderString(HttpHeaders.LOCATION), "/"); assertNotNull(user1Key); - user = JSON_MAPPER.createObjectNode(); + user = MAPPER.createObjectNode(); user.put("username", "vivaldi"); user.put("password", "Password123"); user.put("firstName", "Giovannino"); @@ -501,7 +501,7 @@ public void pull() { String user2Key = StringUtils.substringAfterLast(response.getHeaderString(HttpHeaders.LOCATION), "/"); assertNotNull(user2Key); - user = JSON_MAPPER.createObjectNode(); + user = MAPPER.createObjectNode(); user.put("username", "not.vivaldi"); user.put("password", "Password123"); user.put("email", "not.vivaldi@syncope.org"); @@ -559,12 +559,12 @@ public void pull() { response = webClient.path(user1Key).delete(); assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus()); - user = JSON_MAPPER.createObjectNode(); + user = MAPPER.createObjectNode(); user.put("username", "linkedaccount2"); response = webClient.replacePath(user2Key).put(user.toString()); assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus()); - user = JSON_MAPPER.createObjectNode(); + user = MAPPER.createObjectNode(); user.put("status", "INACTIVE"); response = webClient.replacePath(user3Key).put(user.toString()); assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus()); diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/LiveSyncITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/LiveSyncITCase.java index cb7e1f752f0..68eec54e017 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/LiveSyncITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/LiveSyncITCase.java @@ -146,7 +146,7 @@ private static boolean found(final SyncDeltaType syncDeltaType, final String use SyncDeltaType sdt = null; String uid = null; try { - JsonNode syncDelta = JSON_MAPPER.readTree(record.value()); + JsonNode syncDelta = MAPPER.readTree(record.value()); if (syncDelta.has("deltaType")) { sdt = SyncDeltaType.valueOf(syncDelta.get("deltaType").asText()); } diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java index dd4d98ee80e..9f2d5b0fa33 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java @@ -85,12 +85,6 @@ public void multitenancyCheck() { CLIENT_FACTORY = new SyncopeClientFactoryBean().setAddress(ADDRESS).setDomain("Two"); - String envContentType = System.getProperty(ENV_KEY_CONTENT_TYPE); - if (StringUtils.isNotBlank(envContentType)) { - CLIENT_FACTORY.setContentType(envContentType); - } - LOG.info("Performing IT with content type {}", CLIENT_FACTORY.getContentType().getMediaType()); - ADMIN_CLIENT = CLIENT_FACTORY.create(ADMIN_UNAME, "password2"); } diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/OIDCJWKSITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/OIDCJWKSITCase.java index 0bf741534b3..de1001c6cef 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/OIDCJWKSITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/OIDCJWKSITCase.java @@ -20,10 +20,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.fail; -import static org.junit.jupiter.api.Assumptions.assumeTrue; import jakarta.ws.rs.core.Response; -import org.apache.syncope.client.lib.SyncopeClientFactoryBean; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.types.ClientExceptionType; import org.apache.syncope.common.rest.api.service.OIDCJWKSService; @@ -37,8 +35,6 @@ public class OIDCJWKSITCase extends AbstractITCase { @BeforeAll public static void setup() { - assumeTrue(CLIENT_FACTORY.getContentType() == SyncopeClientFactoryBean.ContentType.JSON); - WA_OIDC_JWKS_SERVICE = ANONYMOUS_CLIENT.getService(OIDCJWKSService.class); } diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/OpenAPIITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/OpenAPIITCase.java index e4e5c168f26..8873c6d28f2 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/OpenAPIITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/OpenAPIITCase.java @@ -39,7 +39,7 @@ public void openapi() throws IOException { Response response = webClient.get(); assertEquals(200, response.getStatus()); - JsonNode tree = JSON_MAPPER.readTree((InputStream) response.getEntity()); + JsonNode tree = MAPPER.readTree((InputStream) response.getEntity()); assertNotNull(tree); JsonNode info = tree.get("info"); diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RESTITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RESTITCase.java index f92f1d7a2d8..dcb438f2f62 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RESTITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RESTITCase.java @@ -30,16 +30,12 @@ import jakarta.ws.rs.core.GenericType; import jakarta.ws.rs.core.HttpHeaders; import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.MultivaluedMap; import jakarta.ws.rs.core.Response; import java.io.IOException; import java.util.List; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.cxf.jaxrs.client.WebClient; -import org.apache.syncope.client.lib.BasicAuthenticationHandler; import org.apache.syncope.client.lib.SyncopeClient; -import org.apache.syncope.client.lib.SyncopeClientFactoryBean; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.request.GroupCR; import org.apache.syncope.common.lib.request.GroupUR; @@ -52,7 +48,6 @@ import org.apache.syncope.common.lib.types.ClientExceptionType; import org.apache.syncope.common.rest.api.Preference; import org.apache.syncope.common.rest.api.RESTHeaders; -import org.apache.syncope.common.rest.api.service.AnyTypeClassService; import org.apache.syncope.common.rest.api.service.ConnectorService; import org.apache.syncope.common.rest.api.service.GroupService; import org.apache.syncope.common.rest.api.service.UserService; @@ -159,32 +154,6 @@ public void ifMatch() { assertTrue(userTO.getUsername().endsWith("XX")); } - @Test - public void defaultContentType() { - // manualy instantiate SyncopeClient so that media type can be set to */* - SyncopeClientFactoryBean factory = new SyncopeClientFactoryBean().setAddress(ADDRESS); - SyncopeClient client = new SyncopeClient( - MediaType.WILDCARD_TYPE, - factory.getRestClientFactoryBean(), - factory.getExceptionMapper(), - new BasicAuthenticationHandler(ADMIN_UNAME, ADMIN_PWD), - false, - null, - null); - - // perform operation - AnyTypeClassService service = client.getService(AnyTypeClassService.class); - service.list(); - - // check that */* was actually sent - MultivaluedMap requestHeaders = WebClient.client(service).getHeaders(); - assertEquals(MediaType.WILDCARD, requestHeaders.getFirst(HttpHeaders.ACCEPT)); - - // check that application/json was received - String contentType = WebClient.client(service).getResponse().getHeaderString(HttpHeaders.CONTENT_TYPE); - assertTrue(contentType.startsWith(MediaType.APPLICATION_JSON)); - } - @Test public void exportInternalStorageContent() throws IOException { Response response = SYNCOPE_SERVICE.exportInternalStorageContent(100, List.of()); diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SAML2IdPEntityITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SAML2IdPEntityITCase.java index 8d56f15e7e2..163655915a8 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SAML2IdPEntityITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SAML2IdPEntityITCase.java @@ -20,11 +20,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assumptions.assumeTrue; import java.nio.charset.StandardCharsets; import java.util.Base64; -import org.apache.syncope.client.lib.SyncopeClientFactoryBean; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.SAML2IdPEntityTO; import org.apache.syncope.common.rest.api.service.SAML2IdPEntityService; @@ -38,8 +36,6 @@ public class SAML2IdPEntityITCase extends AbstractITCase { @BeforeAll public static void setup() { - assumeTrue(CLIENT_FACTORY.getContentType() == SyncopeClientFactoryBean.ContentType.JSON); - WA_SAML2IDP_ENTITY_SERVICE = ANONYMOUS_CLIENT.getService(SAML2IdPEntityService.class); } diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java index 310549c6a53..ca45f70c825 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java @@ -1573,12 +1573,12 @@ public void issueSYNCOPE1699() throws Exception { accept(MediaType.APPLICATION_JSON_TYPE). type(MediaType.APPLICATION_JSON_TYPE); - Response response = webClient.invoke(HttpMethod.PATCH, JSON_MAPPER.writeValueAsString(req)); + Response response = webClient.invoke(HttpMethod.PATCH, MAPPER.writeValueAsString(req)); assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); // Key is mismatched in the path parameter and the request body. req.setKey(UUID.randomUUID().toString()); - response = webClient.invoke(HttpMethod.PATCH, JSON_MAPPER.writeValueAsString(req)); + response = webClient.invoke(HttpMethod.PATCH, MAPPER.writeValueAsString(req)); assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); // reading user by its username still works diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserRequestITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserRequestITCase.java index 1e8904722b3..f3a863c7894 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserRequestITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserRequestITCase.java @@ -23,7 +23,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; -import static org.junit.jupiter.api.Assumptions.assumeFalse; import static org.junit.jupiter.api.Assumptions.assumeTrue; import jakarta.ws.rs.core.GenericType; @@ -33,7 +32,6 @@ import org.apache.cxf.helpers.IOUtils; import org.apache.cxf.jaxrs.client.WebClient; import org.apache.syncope.client.lib.SyncopeClient; -import org.apache.syncope.client.lib.SyncopeClientFactoryBean; import org.apache.syncope.common.lib.SyncopeClientException; import org.apache.syncope.common.lib.to.PagedResult; import org.apache.syncope.common.lib.to.ProvisioningResult; @@ -54,7 +52,6 @@ public class UserRequestITCase extends AbstractITCase { @BeforeAll public static void loadBpmnProcesses() throws IOException { - assumeFalse(CLIENT_FACTORY.getContentType() == SyncopeClientFactoryBean.ContentType.YAML); assumeTrue(IS_FLOWABLE_ENABLED); WebClient.client(BPMN_PROCESS_SERVICE).type(MediaType.APPLICATION_XML_TYPE); @@ -68,7 +65,6 @@ public static void loadBpmnProcesses() throws IOException { @BeforeEach public void check() { - assumeFalse(CLIENT_FACTORY.getContentType() == SyncopeClientFactoryBean.ContentType.YAML); assumeTrue(IS_FLOWABLE_ENABLED); } diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/wa/WAClientAppITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/wa/WAClientAppITCase.java index a5dd774f3ba..54471ac938e 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/wa/WAClientAppITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/wa/WAClientAppITCase.java @@ -22,10 +22,8 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assumptions.assumeTrue; import java.util.List; -import org.apache.syncope.client.lib.SyncopeClientFactoryBean; import org.apache.syncope.common.lib.policy.AccessPolicyTO; import org.apache.syncope.common.lib.policy.AttrReleasePolicyTO; import org.apache.syncope.common.lib.policy.AuthPolicyTO; @@ -50,8 +48,6 @@ public class WAClientAppITCase extends AbstractITCase { @BeforeAll public static void setup() { - assumeTrue(CLIENT_FACTORY.getContentType() == SyncopeClientFactoryBean.ContentType.JSON); - WA_CLIENT_APP_SERVICE = ANONYMOUS_CLIENT.getService(WAClientAppService.class); } diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/enduser/AbstractEnduserITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/enduser/AbstractEnduserITCase.java index a991696dc8c..3bbe0b70a7c 100644 --- a/fit/core-reference/src/test/java/org/apache/syncope/fit/enduser/AbstractEnduserITCase.java +++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/enduser/AbstractEnduserITCase.java @@ -169,7 +169,6 @@ public static void setUp() { @BeforeAll public static void restSetup() { CLIENT_FACTORY = new SyncopeClientFactoryBean().setAddress(ADDRESS); - LOG.info("Performing IT with content type {}", CLIENT_FACTORY.getContentType().getMediaType()); ADMIN_CLIENT = CLIENT_FACTORY.create(ADMIN_UNAME, ADMIN_PWD); diff --git a/fit/wa-reference/src/test/java/org/apache/syncope/fit/ui/SAML2SP4UIITCase.java b/fit/wa-reference/src/test/java/org/apache/syncope/fit/ui/SAML2SP4UIITCase.java index 20f8a8f487f..648d74ebd41 100644 --- a/fit/wa-reference/src/test/java/org/apache/syncope/fit/ui/SAML2SP4UIITCase.java +++ b/fit/wa-reference/src/test/java/org/apache/syncope/fit/ui/SAML2SP4UIITCase.java @@ -116,8 +116,8 @@ public static void idpSetup() { // nothing bad if already imported } finally { WebClient.client(SAML2SP4UI_IDP_SERVICE). - accept(CLIENT_FACTORY.getContentType().getMediaType()). - type(CLIENT_FACTORY.getContentType().getMediaType()); + accept(MediaType.APPLICATION_JSON). + type(MediaType.APPLICATION_JSON); } List idps = SAML2SP4UI_IDP_SERVICE.list(); diff --git a/pom.xml b/pom.xml index d1ec011e38a..192df4244ad 100644 --- a/pom.xml +++ b/pom.xml @@ -2181,7 +2181,7 @@ under the License. 3.12.0 ${targetJdk} - apidocs/4.0 + apidocs/4.1 false true true @@ -2195,21 +2195,19 @@ under the License. https://www.slf4j.org/api/ https://connid.tirasa.net/apidocs/1.6/ https://cxf.apache.org/javadoc/latest/ - https://javadoc.io/static/com.fasterxml.jackson.core/jackson-core/2.17.3/ - https://javadoc.io/static/com.fasterxml.jackson.core/jackson-databind/2.17.3/ - https://javadoc.io/static/com.fasterxml.jackson.core/jackson-annotations/2.17.3/ - https://javadoc.io/static/com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.17.3/ - https://javadoc.io/static/com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/2.17.3/ - https://javadoc.io/static/com.fasterxml.jackson.dataformat/jackson-dataformat-csv/2.17.3/ + https://javadoc.io/static/com.fasterxml.jackson.core/jackson-core/2.19.4/ + https://javadoc.io/static/com.fasterxml.jackson.core/jackson-databind/2.19.4/ + https://javadoc.io/static/com.fasterxml.jackson.core/jackson-annotations/2.19.4/ + https://javadoc.io/static/com.fasterxml.jackson.dataformat/jackson-dataformat-csv/2.19.4/ https://nightlies.apache.org/wicket/apidocs/10.x/ https://commons.apache.org/proper/commons-lang/javadocs/api-release/ https://commons.apache.org/proper/commons-jexl/apidocs/ - https://tika.apache.org/3.2.1/api/ + https://tika.apache.org/3.2.3/api/ https://docs.spring.io/spring-boot/3.4/api/java/ https://docs.spring.io/spring-framework/docs/6.2.x/javadoc-api/ - https://docs.spring.io/spring-security/site/docs/6.4.x/api/ + https://docs.spring.io/spring-security/site/docs/6.5.x/api/ https://www.flowable.com/open-source/docs/javadocs/ - https://docs.swagger.io/swagger-core/v2.2.28/apidocs/ + https://docs.swagger.io/swagger-core/v2.2.41/apidocs/ --legal-notices diff --git a/src/main/asciidoc/reference-guide/architecture/core.adoc b/src/main/asciidoc/reference-guide/architecture/core.adoc index 712c6fee1d3..ab683d35502 100644 --- a/src/main/asciidoc/reference-guide/architecture/core.adoc +++ b/src/main/asciidoc/reference-guide/architecture/core.adoc @@ -34,7 +34,7 @@ given Apache Syncope deployment to complement the native features with domain-sp At a technical level, the RESTful interface is a fully-compliant https://en.wikipedia.org/wiki/Jakarta_RESTful_Web_Services[Jakarta RESTful Web Services 3.1^] implementation based on -http://cxf.apache.org[Apache CXF^], natively dealing either with JSON, YAML and XML payloads. +http://cxf.apache.org[Apache CXF^], natively dealing with JSON payloads. More details are available in the dedicated <> section. diff --git a/src/main/asciidoc/reference-guide/configuration/deployment.adoc b/src/main/asciidoc/reference-guide/configuration/deployment.adoc index 801fa6b600f..6e2068c1390 100644 --- a/src/main/asciidoc/reference-guide/configuration/deployment.adoc +++ b/src/main/asciidoc/reference-guide/configuration/deployment.adoc @@ -144,6 +144,10 @@ Add jakarta.faces ${jakarta.faces.version} + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + .... to `core/pom.xml`, `console/pom.xml`, `enduser/pom.xml` and `wa/pom.xml`, @@ -154,7 +158,7 @@ then replace .... org.apache.syncope.core - syncope-core-persistence-jpa + syncope-core-starter .... @@ -164,7 +168,17 @@ with .... org.apache.syncope.core - syncope-core-persistence-jpa + syncope-core-starter + + + org.apache.tomcat.embed + tomcat-embed-el + + + com.github.ben-manes.caffeine + jcache + + .... diff --git a/src/main/asciidoc/reference-guide/usage/core.adoc b/src/main/asciidoc/reference-guide/usage/core.adoc index 93264fda9bf..5916fc4d58c 100644 --- a/src/main/asciidoc/reference-guide/usage/core.adoc +++ b/src/main/asciidoc/reference-guide/usage/core.adoc @@ -222,8 +222,7 @@ delegating users for each <> for which the requesting use Batch requests allow grouping multiple operations into a single HTTP request payload. + A batch request is represented as a https://tools.ietf.org/html/rfc2046[Multipart MIME v1.0 message^], a standard format -allowing the representation of multiple parts, each of which may have a different content type (currently -JSON, YAML or XML), within a single request. +allowing the representation of multiple parts within a single request. Batch requests are handled by the `/batch` REST endpoint: via HTTP `POST` method to submit requests, via HTTP `GET` method to fetch responses <>. diff --git a/src/site/xdoc/building.xml b/src/site/xdoc/building.xml index de8e088b73c..619a274842b 100644 --- a/src/site/xdoc/building.xml +++ b/src/site/xdoc/building.xml @@ -121,13 +121,6 @@ under the License. subdirectory, not from top-level.

-

Other Content-Type values

- By default, integration tests are run using application/json for both Accept and - Content-Type HTTP headers; it is possible, however, to use application/xml or - application/yaml. - $ mvn clean verify -DjaxrsContentType=application/xml - $ mvn clean verify -DjaxrsContentType=application/yaml -

Debug

Starts the full environment used by integration tests (with same components available when running new project in embedded mode