Git Product home page Git Product logo

ibm-cloud-spring-bind's People

Contributors

dependabot[bot] avatar ebullient avatar gee4vee avatar ibmcloudtools avatar jmeis avatar paulben avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ibm-cloud-spring-bind's Issues

Insufficient Trace/Log

While debugging #8 there really was no other option than to clone the affected classes into the application project and re-instrument them with trace, as there was no other way to determine the paths chosen from the log output, even when configured to output at the finest level.

Eg take this section of code https://github.com/ibm-developer/ibm-cloud-spring-bind/blob/master/src/main/java/com/ibm/cloud/spring/env/CloudServicesConfigMap.java#L106-L126 There's no way to know which of the reasons null is being returned.

Format of the file search pattern is inconsistent

When i bind the service to the application when creating the application using ibmcloud dev create, the file search pattern in the generated mappings.json is something like this file://localdev-config.json:$.cloudant_url which does not work and in here i noticed a different format https://github.com/ibm-developer/ibm-cloud-env#mappingsjson-file-example . What is the correct format?

In order for this format to work file://localdev-config.json:$.cloudant_url, i had to make changes in this line https://github.com/ibm-developer/ibm-cloud-spring-bind/blob/master/src/main/java/com/ibm/cloud/spring/env/CloudServicesConfigMap.java#L269 to this String path = token[0].substring(2);

JSON Parsing failure results in NPE

malformed mappings.json entries such as

  "cloudant": {
    "credentials": {
      "searchPatterns": [
        "user-provided:cloudant-test:username",
        "cloudfoundry:cloudant",
        "env:cloudant_credentials",
        "file:/server/localdev-config.json:cloudant_credentials"
      ]
    }
  }

Cause project start up to fail with an NPE

Caused by: java.lang.NullPointerException
    at com.ibm.cloud.spring.env.CloudServicesConfigMap.getValue (CloudServicesConfigMap.java:128)
    at com.ibm.cloud.spring.env.CloudServicesPropertySource.getProperty (CloudServicesPropertySource.java:39)
    at org.springframework.boot.context.properties.source.SpringConfigurationPropertySource.find (SpringConfigurationPropertySource.java:111)

Seemingly because the code makes an assumption that there will always be an immediate child of a mappings.json entry called searchPatterns and does not test for the situation where that does not exist.

in this case the malformed json has 'credentials' as the child, which means this code
https://github.com/ibm-developer/ibm-cloud-spring-bind/blob/master/src/main/java/com/ibm/cloud/spring/env/CloudServicesConfigMap.java#L127-#L128
fails because 'array' ends up as null causing the NPE.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.