Skip to content
This repository has been archived by the owner on Jul 20, 2021. It is now read-only.

[REST] SweepDetail result not really respectful of JSON #299

Open
coinwalletdev opened this issue May 29, 2020 · 0 comments
Open

[REST] SweepDetail result not really respectful of JSON #299

coinwalletdev opened this issue May 29, 2020 · 0 comments

Comments

@coinwalletdev
Copy link
Contributor

coinwalletdev commented May 29, 2020

SweepDetail API can return multiple keys with the same name (trytes). It should return an array of trytes instead.

See RFC7159 'The names within an object SHOULD be unique'

This is annoying as for example, the code given in the documentation:

var request = require('request');

var command = {
    "command": "SweepDetail",
    "bundleHash" : "EWLCW9FFLSBUGZZOOLFQLTRJFKNGPUVCIOCQYTSDOSZLBCBJIIJZGPALGAKKANBTDYOBVQFOJHA9OVFOY"
}

var options = {
  url: 'http://localhost:50051',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-IOTA-API-Version': '1'
  },
  json: command
};

request(options, function (error, response, data) {
  if (!error && response.statusCode == 200) {
    console.log(data);
  }
});

won't reply all the trytes for some bundleHash.

edit: same goes for tailHash it seems

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant