cytoscape / cyREST

Core App: REST API module for Cytoscape
https://github.com/cytoscape/cyREST/wiki
MIT License
30 stars 13 forks source link

POST /v1/styles/{name}/mappings doesn't handle numeric keys #82

Closed dotasek closed 6 years ago

dotasek commented 6 years ago

POST /v1/styles/{name}/mappings uses textValue() for all values of a key, but keys can be numeric or boolean as well, which will return a null that does not parse. For example, the following entry will result in parse errors:

 { "mappingType": "continuous",
  "mappingColumn": "Degree",
  "mappingColumnType": "Integer",
  "visualProperty": "NODE_SIZE",
  "points": [
      { "value" : 1,
        "lesser" : "10",
        "equal" : "10",
        "greater" : "10"
      },
         { "value" : 20,
        "lesser" : "120",
        "equal" : "120",
        "greater" : "420"      }
    ]
}
dotasek commented 6 years ago

This turns out to be a non-issue. It arose because an R library was attempting to make a call with "value" being an integer, but all actual returns from CyREST, and relevant Swagger models, use and specify Strings to be parsed, which will work fine as it.