SAP / cloud-sdk-java

Use the SAP Cloud SDK for Java to reduce development effort when building applications on SAP Business Technology Platform that communicate with SAP solutions and services such as SAP S/4HANA Cloud, SAP SuccessFactors, and many others.
Apache License 2.0
22 stars 13 forks source link

Include enumUnknownDefaultCase in java class template #566

Closed jeevantheqa closed 2 months ago

jeevantheqa commented 2 months ago

Issue Description

We consume SAP Cloud Identity Services - Application Configuration API in our project and use sap-cloud-sdk openapi-generator to generate JAVA classes. Any change in the schema of Application Configuration API breaks our application and we need to regenerate the JAVA classes with the new schema. To avoid this, we tried to use enumUnknownDefaultCase by setting it in the additionalProperties of the sap-cloud-sdk maven plugin. This introduced a new enum UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); in the JAVA classes, but did not modify the @JasonCreator function to return the unknown enum.

Issue might be that, sap-cloud-sdk does not return the unknown_default_open_api option, where as the official openapi-generator includes it.

Impact / Priority

Affected development phase: Development, Production

Impact: Impaired

Timeline: NA

Error Message

Caused by: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot construct instance of `com.sap.bpi.spide.usermgmt.ias.api.apps.model.SchemasEnum`, problem: Unexpected value 'urn:sap:identity:application:schemas:extension:sci:1.0:Authentication'

--- maven-dependency-plugin:2.8:tree (default-cli) @ bpi-spide-user-mgmt-api --- [INFO] com.sap.bpi:bpi-spide-user-mgmt-api:jar:0.1.0-SNAPSHOT [INFO] +- com.sap.cds:cds-starter-spring-boot:jar:2.10.1:compile [INFO] | +- com.sap.cds:cds-services-api:jar:2.10.1:compile [INFO] | | +- com.sap.cds:cds4j-api:jar:2.10.1:compile [INFO] | | - com.sap.cloud.environment.servicebinding.api:java-core-api:jar:0.10.5:compile [INFO] | +- com.sap.cds:cds-services-impl:jar:2.10.1:runtime [INFO] | | +- com.sap.cds:cds-services-messaging:jar:2.10.1:runtime [INFO] | | | - jakarta.jms:jakarta.jms-api:jar:3.1.0:runtime [INFO] | | +- com.sap.cloud.environment.servicebinding.api:java-access-api:jar:0.10.5:compile [INFO] | | - org.apache.commons:commons-csv:jar:1.11.0:runtime [INFO] | +- com.sap.cds:cds-feature-jdbc:jar:2.10.1:runtime [INFO] | | +- com.sap.cds:cds4j-runtime:jar:2.10.1:runtime [INFO] | | | - com.sap.cds:cds4j-jdbc-spi:jar:2.10.1:runtime [INFO] | | - com.sap.cds:cds4j-tx:jar:2.10.1:runtime [INFO] | +- com.sap.cds:cds-framework-spring-boot:jar:2.10.1:runtime [INFO] | +- org.springframework.boot:spring-boot-starter-web:jar:3.3.1:compile [INFO] | | +- org.springframework.boot:spring-boot-starter-tomcat:jar:3.3.1:compile [INFO] | | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:10.1.25:compile [INFO] | | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:10.1.25:compile [INFO] | | | - org.apache.tomcat.embed:tomcat-embed-websocket:jar:10.1.25:compile [INFO] | | - org.springframework:spring-webmvc:jar:6.1.10:compile [INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:3.3.1:compile [INFO] | | +- com.zaxxer:HikariCP:jar:5.1.0:compile [INFO] | | - org.springframework:spring-jdbc:jar:6.1.10:compile [INFO] | | - org.springframework:spring-tx:jar:6.1.10:compile [INFO] | - org.yaml:snakeyaml:jar:2.2:compile [INFO] +- com.sap.cds:cds-adapter-odata-v4:jar:2.10.1:runtime [INFO] | +- com.sap.cds:cds-adapter-api:jar:2.10.1:compile [INFO] | +- com.sap.cds:cds-services-utils:jar:2.10.1:compile [INFO] | | +- io.opentelemetry:opentelemetry-api:jar:1.37.0:compile [INFO] | | | - io.opentelemetry:opentelemetry-context:jar:1.37.0:compile [INFO] | | +- org.apache.commons:commons-lang3:jar:3.14.0:compile [INFO] | | +- com.sap.cloud.security.xsuaa:token-client:jar:3.5.0:compile [INFO] | | - com.sap.cloud.mt:tools:jar:2.10.1:compile [INFO] | +- com.sap.cds:cds4j-core:jar:2.10.1:compile [INFO] | | - com.github.ben-manes.caffeine:caffeine:jar:3.1.8:compile [INFO] | +- com.sap.cloud.mt:cds-mtx:jar:2.10.1:compile [INFO] | | - commons-io:commons-io:jar:2.16.1:compile [INFO] | +- com.sap.cds.repackaged:odata-v4-lib:jar:2.10.1:runtime [INFO] | | +- commons-codec:commons-codec:jar:1.16.1:compile [INFO] | | +- org.apache.httpcomponents:httpclient:jar:4.5.14:compile [INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.17.1:runtime [INFO] | | | - org.codehaus.woodstox:stax2-api:jar:4.2.2:runtime [INFO] | | - com.fasterxml:aalto-xml:jar:1.3.2:runtime [INFO] | - org.slf4j:slf4j-api:jar:2.0.13:compile [INFO] +- com.sap.cloud.sdk.datamodel:openapi-core:jar:5.10.0:compile [INFO] | +- com.sap.cloud.sdk.cloudplatform:cloudplatform-connectivity:jar:5.10.0:compile [INFO] | | +- com.sap.cloud.sdk.cloudplatform:cloudplatform-core:jar:5.10.0:compile [INFO] | | +- com.sap.cloud.sdk.cloudplatform:resilience-api:jar:5.10.0:compile [INFO] | | +- org.slf4j:jcl-over-slf4j:jar:2.0.13:runtime [INFO] | | +- io.vavr:vavr:jar:0.10.4:compile [INFO] | | | - io.vavr:vavr-match:jar:0.10.4:compile [INFO] | | +- com.mikesamuel:json-sanitizer:jar:1.2.3:compile [INFO] | | +- com.auth0:java-jwt:jar:4.4.0:compile [INFO] | | +- org.bouncycastle:bcprov-jdk18on:jar:1.78.1:compile [INFO] | | - org.bouncycastle:bcpkix-jdk18on:jar:1.78.1:compile [INFO] | | - org.bouncycastle:bcutil-jdk18on:jar:1.78.1:compile [INFO] | +- com.sap.cloud.sdk.cloudplatform:connectivity-apache-httpclient5:jar:5.10.0:compile [INFO] | | +- com.sap.cloud.sdk.cloudplatform:caching:jar:5.10.0:compile [INFO] | | - org.apache.httpcomponents.core5:httpcore5:jar:5.2.4:compile [INFO] | +- org.apache.httpcomponents.client5:httpclient5:jar:5.3.1:compile [INFO] | | - org.apache.httpcomponents.core5:httpcore5-h2:jar:5.2.4:compile [INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.17.1:compile [INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.17.1:compile [INFO] | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.17.1:compile [INFO] | +- org.springframework:spring-core:jar:6.1.10:compile [INFO] | | - org.springframework:spring-jcl:jar:6.1.10:compile [INFO] | +- org.springframework:spring-web:jar:6.1.10:compile [INFO] | | - org.springframework:spring-beans:jar:6.1.10:compile [INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.17.1:compile [INFO] | - com.google.code.findbugs:jsr305:jar:3.0.2:compile [INFO] +- com.sap.cloud.sdk.cloudplatform:scp-cf:jar:5.10.0:compile [INFO] | - com.sap.cloud.sdk:sdk-core:jar:5.10.0:compile [INFO] | +- com.sap.cloud.sdk.cloudplatform:connectivity-destination-service:jar:5.10.0:compile [INFO] | | - com.google.code.gson:gson:jar:2.11.0:compile [INFO] | +- com.sap.cloud.sdk.cloudplatform:servlet-jakarta:jar:5.10.0:compile [INFO] | - com.sap.cloud.sdk.cloudplatform:resilience:jar:5.10.0:compile [INFO] | - com.sap.cloud.sdk.cloudplatform:resilience4j:jar:5.10.0:compile [INFO] +- com.sap.cds:cds-integration-cloud-sdk:jar:2.10.1:compile [INFO] | +- com.sap.cloud.sdk.cloudplatform:tenant:jar:5.10.0:compile [INFO] | +- com.sap.cloud.sdk.cloudplatform:security:jar:5.10.0:compile [INFO] | | - org.apache.httpcomponents:httpcore:jar:4.4.16:compile [INFO] | +- com.sap.cloud.sdk.cloudplatform:connectivity-oauth:jar:5.10.0:compile [INFO] | | +- com.sap.cloud.sdk.cloudplatform:connectivity-apache-httpclient4:jar:5.10.0:compile [INFO] | | +- com.sap.cloud.environment.servicebinding.api:java-consumption-api:jar:0.10.5:compile [INFO] | | - com.sap.cloud.security:java-api:jar:3.5.0:compile [INFO] | - com.sap.cloud.sdk.frameworks:resilience4j:jar:4.31.0:compile [INFO] | +- io.github.resilience4j:resilience4j-circuitbreaker:jar:2.2.0:compile [INFO] | | - io.github.resilience4j:resilience4j-core:jar:2.2.0:compile [INFO] | +- io.github.resilience4j:resilience4j-bulkhead:jar:2.2.0:compile [INFO] | +- io.github.resilience4j:resilience4j-timelimiter:jar:2.2.0:compile [INFO] | +- io.github.resilience4j:resilience4j-retry:jar:2.2.0:compile [INFO] | +- io.github.resilience4j:resilience4j-ratelimiter:jar:2.2.0:compile [INFO] | - javax.cache:cache-api:jar:1.1.1:compile [INFO] +- com.sap.cds:cds-feature-auditlog-v2:jar:2.10.1:compile [INFO] | +- com.sap.cloud.sjb:xs-env:jar:1.49.0:compile [INFO] | +- com.sap.cloud.security:java-security:jar:3.5.0:compile [INFO] | - com.sap.cloud.security:env:jar:3.5.0:compile [INFO] | +- com.sap.cloud.environment.servicebinding:java-sap-vcap-services:jar:0.10.5:compile [INFO] | +- com.sap.cloud.environment.servicebinding:java-sap-service-operator:jar:0.10.5:compile [INFO] | - org.json:json:jar:20240303:compile [INFO] +- com.sap.bpi:bpi-common-utils:jar:2.52.0:compile [INFO] | +- com.sap.hcp.cf.logging:cf-java-logging-support-log4j2:jar:3.8.3:compile [INFO] | | - com.sap.hcp.cf.logging:cf-java-logging-support-core:jar:3.8.3:compile [INFO] | | - com.fasterxml.jackson.jr:jackson-jr-objects:jar:2.17.1:compile [INFO] | +- com.sap.hcp.cf.logging:cf-java-logging-support-servlet-jakarta:jar:3.8.3:compile [INFO] | +- com.sap.cds:cds-starter-spring-boot-odata:jar:2.10.1:compile [INFO] | +- com.sap.cds:cds-feature-xsuaa:jar:2.10.1:compile [INFO] | +- org.springframework.boot:spring-boot-starter-security:jar:3.3.1:compile [INFO] | | +- org.springframework:spring-aop:jar:6.1.10:compile [INFO] | | - org.springframework.security:spring-security-config:jar:6.3.1:compile [INFO] | +- org.springframework.retry:spring-retry:jar:2.0.6:compile [INFO] | +- com.google.guava:guava:jar:33.2.1-jre:compile [INFO] | | +- com.google.guava:failureaccess:jar:1.0.2:compile [INFO] | | +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile [INFO] | | +- org.checkerframework:checker-qual:jar:3.44.0:compile [INFO] | | +- com.google.errorprone:error_prone_annotations:jar:2.28.0:compile [INFO] | | - com.google.j2objc:j2objc-annotations:jar:3.0.0:compile [INFO] | +- commons-validator:commons-validator:jar:1.9.0:compile [INFO] | | +- commons-beanutils:commons-beanutils:jar:1.9.4:compile [INFO] | | +- commons-digester:commons-digester:jar:2.1:compile [INFO] | | +- commons-logging:commons-logging:jar:1.3.2:compile [INFO] | | - commons-collections:commons-collections:jar:3.2.2:compile [INFO] | +- org.projectlombok:lombok:jar:1.18.34:compile [INFO] | - com.sap.clm.sl.ans:ans-client:jar:1.92.0:compile [INFO] | +- io.pivotal.cfenv:java-cfenv:jar:2.5.0:compile [INFO] | - org.codehaus.plexus:plexus-utils:jar:4.0.0:compile [INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:3.3.1:compile [INFO] | +- org.springframework.boot:spring-boot-starter:jar:3.3.1:compile [INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:3.3.1:compile [INFO] | | | - org.slf4j:jul-to-slf4j:jar:2.0.13:compile [INFO] | | - jakarta.annotation:jakarta.annotation-api:jar:2.1.1:compile [INFO] | +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:3.3.1:compile [INFO] | | - org.springframework.boot:spring-boot-actuator:jar:3.3.1:compile [INFO] | +- io.micrometer:micrometer-observation:jar:1.13.1:compile [INFO] | | - io.micrometer:micrometer-commons:jar:1.13.1:compile [INFO] | - io.micrometer:micrometer-jakarta9:jar:1.13.1:compile [INFO] | - io.micrometer:micrometer-core:jar:1.13.1:compile [INFO] | +- org.hdrhistogram:HdrHistogram:jar:2.2.2:runtime [INFO] | - org.latencyutils:LatencyUtils:jar:2.0.3:runtime [INFO] +- org.springframework.boot:spring-boot-starter-log4j2:jar:3.3.1:compile [INFO] | +- org.apache.logging.log4j:log4j-slf4j2-impl:jar:2.23.1:compile [INFO] | | - org.apache.logging.log4j:log4j-api:jar:2.23.1:compile [INFO] | +- org.apache.logging.log4j:log4j-core:jar:2.23.1:compile [INFO] | - org.apache.logging.log4j:log4j-jul:jar:2.23.1:compile [INFO] +- org.springframework.boot:spring-boot-devtools:jar:3.3.1:compile [INFO] | +- org.springframework.boot:spring-boot:jar:3.3.1:compile [INFO] | | - org.springframework:spring-context:jar:6.1.10:compile [INFO] | - org.springframework.boot:spring-boot-autoconfigure:jar:3.3.1:compile [INFO] +- com.sap.cds:cds-starter-cloudfoundry:jar:2.10.1:compile [INFO] | +- com.sap.cds:cds-feature-hana:jar:2.10.1:compile [INFO] | | - com.sap.cloud.db.jdbc:ngdbc:jar:2.21.11:provided [INFO] | +- com.sap.cds:cds-feature-cloudfoundry:jar:2.10.1:compile [INFO] | +- com.sap.cds:cds-feature-identity:jar:2.10.1:compile [INFO] | +- com.sap.cloud.security.xsuaa:xsuaa-spring-boot-starter:jar:3.5.0:compile [INFO] | | +- com.sap.cloud.security.xsuaa:spring-xsuaa:jar:3.5.0:compile [INFO] | | | - com.nimbusds:nimbus-jose-jwt:jar:9.40:compile [INFO] | | +- org.springframework.security:spring-security-oauth2-jose:jar:6.3.1:compile [INFO] | | | - org.springframework.security:spring-security-oauth2-core:jar:6.3.1:compile [INFO] | | - org.springframework.security:spring-security-oauth2-resource-server:jar:6.3.1:compile [INFO] | - com.sap.cloud.security:resourceserver-security-spring-boot-starter:jar:3.5.0:compile [INFO] | - com.sap.cloud.security:spring-security:jar:3.5.0:compile [INFO] +- jakarta.mail:jakarta.mail-api:jar:2.1.1:compile [INFO] | - jakarta.activation:jakarta.activation-api:jar:2.1.3:compile [INFO] +- junit:junit:jar:4.13.2:test [INFO] | - org.hamcrest:hamcrest-core:jar:2.2:test [INFO] +- org.springframework.boot:spring-boot-starter-test:jar:3.3.1:test [INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:3.3.1:test [INFO] | +- com.jayway.jsonpath:json-path:jar:2.9.0:test [INFO] | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:4.0.2:test [INFO] | +- net.minidev:json-smart:jar:2.5.1:test [INFO] | | - net.minidev:accessors-smart:jar:2.5.1:test [INFO] | | - org.ow2.asm:asm:jar:9.6:test [INFO] | +- org.assertj:assertj-core:jar:3.25.3:test [INFO] | | - net.bytebuddy:byte-buddy:jar:1.14.17:test [INFO] | +- org.awaitility:awaitility:jar:4.2.1:test [INFO] | +- org.hamcrest:hamcrest:jar:2.2:test [INFO] | +- org.junit.jupiter:junit-jupiter:jar:5.10.3:test [INFO] | | +- org.junit.jupiter:junit-jupiter-api:jar:5.10.2:test [INFO] | | | +- org.opentest4j:opentest4j:jar:1.3.0:test [INFO] | | | +- org.junit.platform:junit-platform-commons:jar:1.10.2:test [INFO] | | | - org.apiguardian:apiguardian-api:jar:1.1.2:test [INFO] | | +- org.junit.jupiter:junit-jupiter-params:jar:5.10.2:test [INFO] | | - org.junit.jupiter:junit-jupiter-engine:jar:5.10.2:test [INFO] | | - org.junit.platform:junit-platform-engine:jar:1.10.2:test [INFO] | +- org.mockito:mockito-core:jar:5.12.0:test [INFO] | | +- net.bytebuddy:byte-buddy-agent:jar:1.14.17:test [INFO] | | - org.objenesis:objenesis:jar:3.3:test [INFO] | +- org.mockito:mockito-junit-jupiter:jar:5.11.0:test [INFO] | +- org.skyscreamer:jsonassert:jar:1.5.1:test [INFO] | | - com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test [INFO] | +- org.springframework:spring-test:jar:6.1.10:test [INFO] | - org.xmlunit:xmlunit-core:jar:2.9.1:test [INFO] +- org.springframework.security:spring-security-test:jar:6.3.1:test [INFO] | +- org.springframework.security:spring-security-core:jar:6.3.1:compile [INFO] | | +- org.springframework.security:spring-security-crypto:jar:6.3.1:compile [INFO] | | - org.springframework:spring-expression:jar:6.1.10:compile [INFO] | - org.springframework.security:spring-security-web:jar:6.3.1:compile [INFO] +- org.springframework.boot:spring-boot-starter-webflux:jar:3.3.1:test [INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:3.3.1:compile [INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.17.1:compile [INFO] | | - com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.17.1:compile [INFO] | +- org.springframework.boot:spring-boot-starter-reactor-netty:jar:3.3.1:test [INFO] | | - io.projectreactor.netty:reactor-netty-http:jar:1.1.20:test [INFO] | | +- io.netty:netty-codec-http:jar:4.1.111.Final:test [INFO] | | | +- io.netty:netty-common:jar:4.1.111.Final:test [INFO] | | | +- io.netty:netty-buffer:jar:4.1.111.Final:test [INFO] | | | +- io.netty:netty-transport:jar:4.1.111.Final:test [INFO] | | | +- io.netty:netty-codec:jar:4.1.111.Final:test [INFO] | | | - io.netty:netty-handler:jar:4.1.111.Final:test [INFO] | | +- io.netty:netty-codec-http2:jar:4.1.111.Final:test [INFO] | | +- io.netty:netty-resolver-dns:jar:4.1.111.Final:test [INFO] | | | +- io.netty:netty-resolver:jar:4.1.111.Final:test [INFO] | | | - io.netty:netty-codec-dns:jar:4.1.111.Final:test [INFO] | | +- io.netty:netty-resolver-dns-native-macos:jar:osx-x86_64:4.1.111.Final:test [INFO] | | | - io.netty:netty-resolver-dns-classes-macos:jar:4.1.111.Final:test [INFO] | | +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.111.Final:test [INFO] | | | +- io.netty:netty-transport-native-unix-common:jar:4.1.111.Final:test [INFO] | | | - io.netty:netty-transport-classes-epoll:jar:4.1.111.Final:test [INFO] | | - io.projectreactor.netty:reactor-netty-core:jar:1.1.20:test [INFO] | | - io.netty:netty-handler-proxy:jar:4.1.111.Final:test [INFO] | | - io.netty:netty-codec-socks:jar:4.1.111.Final:test [INFO] | - org.springframework:spring-webflux:jar:6.1.10:test [INFO] | - io.projectreactor:reactor-core:jar:3.6.7:compile [INFO] | - org.reactivestreams:reactive-streams:jar:1.0.4:compile [INFO] +- org.springframework.boot:spring-boot-test:jar:3.3.1:test [INFO] +- com.lmax:disruptor:jar:4.0.0:compile [INFO] - com.sap.cds:cds-feature-mt:jar:2.10.1:compile [INFO] +- com.sap.cloud.mt:multi-tenant-runtime:jar:2.10.1:compile [INFO] - com.sap.cloud.mt:multi-tenant-subscription:jar:2.10.1:compile [INFO] +- com.sap.cloud.instancemanager:client:jar:3.14.0:compile [INFO] | - com.sap.hcp.cf.logging:cf-java-logging-support-logback:jar:3.6.3:compile [INFO] - org.apache.commons:commons-collections4:jar:4.4:compile

Project Details


Checklist

newtork commented 2 months ago

I created a PR to address your (valid) concern: https://github.com/SAP/cloud-sdk-java/pull/572

MatKuhr commented 2 months ago

Hi @ jeevantheqa, glad to let you know the improvement has been implemented and shipped with version 5.12.0. Please let us know if something doesn't work as expected 😉

jeevantheqa commented 2 months ago

Hi @ jeevantheqa, glad to let you know the improvement has been implemented and shipped with version 5.12.0. Please let us know if something doesn't work as expected 😉

thanks for the fix @MatKuhr. We will test this and let you if we have any issues.