Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST API responses missing falsey values #2087

Closed
wbobeirne opened this issue Oct 23, 2018 · 3 comments · Fixed by #3965
Closed

REST API responses missing falsey values #2087

wbobeirne opened this issue Oct 23, 2018 · 3 comments · Fixed by #3965
Labels
beginner Issues suitable for new developers gRPC P4 low prio REST rpc Related to the RPC interface

Comments

@wbobeirne
Copy link

Background

The /v1/channels GET endpoint comes back with {} if you have no channels. This is inconsistent with the gRPC API which comes back with { "channels": [] }.

Your environment

  • version of lnd 0.5.0-beta
  • which operating system (uname -a on *Nix) - macOS
  • version of btcd, bitcoind, or other backend - btcd simnet

Steps to reproduce

Hit the GET /v1/channels endpoint

Expected behaviour

{ "channels": [] }

Actual behaviour

{}

@wbobeirne
Copy link
Author

I noticed this as well with the balance API when you have zero balance (for v1/balance/blockchain and v1/balance/channels) so I assume the api is just stripping out all falsey values or empty arrays. I'm going to change the issue title to reflect that larger scope.

@wbobeirne wbobeirne changed the title /v1/channels GET endpoint response missing channels array if no channels REST API responses missing falsey values Oct 23, 2018
@Roasbeef
Copy link
Member

Yep, it's just the API removing "false-y" values. If the key isn't there, then you can assume it simply isn't present. In one case, there are no channels at all, in the other case, it looks like there have been in the DB in the past, so a slice gets created, but not fully populated.

@Roasbeef Roasbeef added rpc Related to the RPC interface gRPC beginner Issues suitable for new developers REST P4 low prio labels Oct 23, 2018
@cfromknecht
Copy link
Contributor

relevant? grpc-ecosystem/grpc-gateway#233 (comment)

looks like work on this in being done for 2.0 grpc-ecosystem/grpc-gateway#546

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner Issues suitable for new developers gRPC P4 low prio REST rpc Related to the RPC interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants