Feature request: Add support for arbitrary parameters when binding services via manifest.yml

Open
#1,142 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
api, cloud

Research direction

Start with ApplicationManifestUtils, especially asList, asListOfString, and toApplicationManifest, using the supplied manifest as the reproduction case. Trace how service binding parameters are converted and verify that nested parameter mappings parse without the reported ClassCastException while preserving their values.

Written by the indexing model from the issue text.

Description

enhancement triaged

Hello,

I want to report this error when we push an app manifest with binding parameters. It seems that the manifest yaml doesn't get parsed correctly because the format is not supported

java.lang.ClassCastException: Cannot cast java.util.LinkedHashMap to java.lang.String
	at java.lang.Class.cast(Class.java:3369)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485)
	at org.cloudfoundry.operations.applications.ApplicationManifestUtils.lambda$asList$2(ApplicationManifestUtils.java:160)
	at java.util.Optional.ifPresent(Optional.java:159)
	at org.cloudfoundry.operations.applications.ApplicationManifestUtils.as(ApplicationManifestUtils.java:131)
	at org.cloudfoundry.operations.applications.ApplicationManifestUtils.asList(ApplicationManifestUtils.java:157)
	at org.cloudfoundry.operations.applications.ApplicationManifestUtils.asListOfString(ApplicationManifestUtils.java:164)
	at org.cloudfoundry.operations.applications.ApplicationManifestUtils.toApplicationManifest(ApplicationManifestUtils.java:346)
	at org.cloudfoundry.operations.applications.ApplicationManifestUtils.lambda$doRead$9(ApplicationManifestUtils.java:236)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	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:566)
	at org.cloudfoundry.operations.applications.ApplicationManifestUtils.doRead(ApplicationManifestUtils.java:240)
	at org.cloudfoundry.operations.applications.ApplicationManifestUtils.read(ApplicationManifestUtils.java:73)
	at org.cloudfoundry.operations.applications.ApplicationManifestUtils$read.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
Manifest format:
--- 
applications: 
- name: my-app
  services:
  - name: my-service1
    parameters: 
      foo: bar
      herp: derp
  - name: my-service2
    parameters: 
      foo: bar
  For more details on the binding params please read: https://docs.cloudfoundry.org/devguide/services/application-binding.html#-binding-with-application-manifest

Best regards.

Dominant language
Java
Stars
334
Forks
319
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudfoundry/cf-java-client

All issues in cloudfoundry/cf-java-client

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.