commercetools / commercetools-jvm-sdk

The e-commerce SDK from commercetools running on the Java virtual machine.
https://commercetools.github.io/commercetools-jvm-sdk/apidocs/index.html
Other
62 stars 40 forks source link

SphereProjectScope is incomplete #1455

Closed schleichardt closed 7 years ago

schleichardt commented 7 years ago

io.sphere.sdk.client.SphereProjectScope is missing at least CREATE_ANONYMOUS_TOKEN

https://dev.commercetools.com/http-api-authorization.html#scopes

Exception in thread "main" java.lang.IllegalArgumentException: No enum constant io.sphere.sdk.client.SphereProjectScope.CREATE_ANONYMOUS_TOKEN
    at java.lang.Enum.valueOf(Enum.java:238)
    at io.sphere.sdk.client.SphereProjectScope.valueOf(SphereProjectScope.java:3)
    at io.sphere.sdk.client.SphereProjectScope.ofScopeString(SphereProjectScope.java:50)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
    at io.sphere.sdk.client.SphereClientConfigUtils.scopesAsCommaSeparatedStringsToList(SphereClientConfigUtils.java:90)
    at io.sphere.sdk.client.SphereClientConfigUtils.ofProperties(SphereClientConfigUtils.java:77)
    at io.sphere.sdk.client.SphereClientConfig.ofProperties(SphereClientConfig.java:160)
katmatt commented 7 years ago

A had a quick discussion with @schleichardt about this issue and Michael suggested that we may completely remove this enum and instead use String.

ccsalazarr-commercetools commented 7 years ago

@katmatt, if the idea is to use Strings now, is it worthwhile to add the missing scopes into the class?, becasue now the SphereProjectScope will have an of(String scope) method.