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

Why reference_url in JSON output is *list* ? #134

Open
ulidtko opened this issue May 6, 2020 · 1 comment
Open

Why reference_url in JSON output is *list* ? #134

ulidtko opened this issue May 6, 2020 · 1 comment

Comments

@ulidtko
Copy link

ulidtko commented May 6, 2020

Hi! Take this JSON output for example:

  {
    "instruction": "EXPOSE",
    "count": 1,
    "level": "info",
    "message": "There is no 'EXPOSE' instruction",
    "description": "Without exposed ports how will the service of the container be accessed?",
    "reference_url": [
      "https://docs.docker.com/engine/reference/builder/",
      "#expose"
    ]
  }

I wonder, what is the big idea behind reference_url being a list, rather than a usual single-string URL as one might expect?

Duplicated anchors

Relatedly: I find that, inconsistently, some reference_url responses contain just one anchor marker #, while some other responses contain it twice, like here:

"reference_url": [
      "http://docs.projectatomic.io/container-best-practices/#",
      "#_using_semi_colons_vs_double_ampersands"
    ],

This makes it yet harder to consume reference_url in code — for no apparent reason.

Breaking change of schema?

Finally: can this be fixed at all? I.e. will maintainers merge a patch changing reference_url format to simple string?

Considering that --json is obviously made for programmatic consumption — changing the schema may potentially break some [careless] consumers. Although I'm unsure how numerous are consumers of this... rather strange reference_url schema, and if they'd want to migrate to a scalar string anyway.

I'm asking to gain understanding (whether this is an oversight or an intentional decision) before I introduce one more consumer in ALE's dockerfile_lint integration. Notice that it currently ignores reference_url altogether (probably because of its weird and unwieldy format). Should I encode string catenation and ## replacement there? Can I, future-compatibly, expect a plain string instead?

@JonZeolla
Copy link

I have the same question; interested in the background.

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

No branches or pull requests

2 participants