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

IPFS API ipfs commands --flags response does not show flags #2301

Closed
RichardLitt opened this issue Feb 4, 2016 · 4 comments
Closed

IPFS API ipfs commands --flags response does not show flags #2301

RichardLitt opened this issue Feb 4, 2016 · 4 comments
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) topic/commands Topic commands

Comments

@RichardLitt
Copy link
Member

ipfs commands --flags

Works in the CLI:

$ ipfs commands --flags
ipfs
ipfs add
ipfs add --chunker / ipfs add -s
ipfs add --hidden / ipfs add -H
ipfs add --only-hash / ipfs add -n
ipfs add --pin
ipfs add --progress / ipfs add -p
ipfs add --quiet / ipfs add -q
ipfs add --recursive / ipfs add -r
ipfs add --trickle / ipfs add -t
ipfs add --wrap-with-directory / ipfs add -w

Does nothing in the HTTP API:

curl -i "http://localhost:5001/api/v0/commands?flags"
HTTP/1.1 200 OK
Content-Type: application/json
Trailer: X-Stream-Error
Transfer-Encoding: chunked
Date: Thu, 04 Feb 2016 23:33:57 GMT
Transfer-Encoding: chunked

{
  "Name": "ipfs",
  "Subcommands": [
    {
      "Name": "name",
      "Subcommands": [
        {
          "Name": "publish",
          "Subcommands": [],
          "Options": [
            {},
            {},
            {}
          ],
          "ShowOptions": true
        },
        {
          "Name": "resolve",
          "Subcommands": [],
          "Options": [
            {},
            {}
          ],
          "ShowOptions": true
        }
      ],
      "Options": null,
      "ShowOptions": true
    },

It does turn ShowOptions to true, which is good. But where are the options?

From ipfs-inactive/http-api-spec#34

@daviddias daviddias added kind/bug A bug in existing code (including security flaws) exp/novice Someone with a little familiarity can pick up topic/commands Topic commands labels Feb 19, 2016
@RichardLitt RichardLitt added help wanted Seeking public contribution on this issue and removed help wanted Seeking public contribution on this issue labels May 31, 2016
@RichardLitt RichardLitt reopened this Jun 1, 2016
@RichardLitt
Copy link
Member Author

Reopening as I'm not sure this is closed - while it does now show flags,

 curl -i http://localhost:5001/api/v0/commands?flags=true

and

 curl -i http://localhost:5001/api/v0/commands

Are no different in their response. Shouldn't they be?

@Kubuxu
Copy link
Member

Kubuxu commented Jun 1, 2016

flags=true is more of formatting option for text based output. It don't really make sense for JSON based API to remove those fields.

@RichardLitt
Copy link
Member Author

Aight. In that case, the API is fine, and I am happy. thanks.

Could this be used to help with autogenerating snyposes, @Kubuxu?

@Kubuxu
Copy link
Member

Kubuxu commented Jun 1, 2016

Possibly, we would have to think about it and you would have to show me what exact style of synopses you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) topic/commands Topic commands
Projects
None yet
Development

No branches or pull requests

3 participants