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

jls: IPv4/v6 should use a hyphen with libxo #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jlduran
Copy link
Owner

@jlduran jlduran commented Oct 4, 2023

As stated in libxo's best practices, field names should be kebab-cased, it is better for XML output and JSON output can always use the XOF_UNDERSCORES flag to generate underscores.

Before:

% jls --libxo json,pretty
{
  "__version": "2",
  "jail-information": {
    "jail": [
      {
        ...
        "ipv4_addrs": [],
        "ipv6_addrs": []
      }
    ]
  }
}

After:

% jls --libxo json,pretty
{
  "__version": "3",
  "jail-information": {
    "jail": [
      {
        ...
        "ipv4-addrs": [],
        "ipv6-addrs": []
      }
    ]
  }
}

Or, if underscores are preferred:

% jls --libxo json,underscore,pretty
{
  "__version": "3",
  "jail_information": {
    "jail": [
      {
        ...
        "ipv4_addrs": [],
        "ipv6_addrs": []
      }
    ]
  }
}

As stated in libxo's best practices, field names should be kebab-cased,
it is better for XML output and JSON output can always use the
XOF_UNDERSCORES flag to generate underscores.

Before:
    % jls --libxo json,pretty
    {
      "__version": "2",
      "jail-information": {
        "jail": [
          {
            ...
            "ipv4_addrs": [],
            "ipv6_addrs": []
          }
        ]
      }
    }

After:
    % jls --libxo json,pretty
    {
      "__version": "3",
      "jail-information": {
        "jail": [
          {
            ...
            "ipv4-addrs": [],
            "ipv6-addrs": []
          }
        ]
      }
    }

Or, if underscores are preferred:

    % jls --libxo json,underscore,pretty
    {
      "__version": "3",
      "jail_information": {
        "jail": [
          {
            ...
            "ipv4_addrs": [],
            "ipv6_addrs": []
          }
        ]
      }
    }
@jlduran jlduran self-assigned this Oct 4, 2023
@jlduran
Copy link
Owner Author

jlduran commented Oct 4, 2023

Note this change warrants a bump in the API version.

More tests are required before submitting it upstream.

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

Successfully merging this pull request may close these issues.

None yet

1 participant