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

Guidelines for extensible JSON #7823

Closed
roberth opened this issue Feb 13, 2023 · 3 comments · Fixed by #7883
Closed

Guidelines for extensible JSON #7823

roberth opened this issue Feb 13, 2023 · 3 comments · Fixed by #7883
Assignees
Labels
documentation feature Feature request or proposal idea approved The given proposal has been discussed and approved by the Nix team. An implementation is welcome. new-cli Relating to the "nix" command

Comments

@roberth
Copy link
Member

roberth commented Feb 13, 2023

Is your feature request related to a problem? Please describe.

Commands with --json need to be future proof.

Describe the solution you'd like

We need JSON guidelines.

  • The top level object must always be a record
  • The value of a dictionary must always be a record
  • List items should be records

Definitions

  • dictionary: a map from names to things that all have the same type (C++ std::map)
  • record: a fixed set of attributes each with their own type (C++ struct)

In case of streaming json (json lines, etc), the rules apply such that each value is regarded as a top level object.

Describe alternatives you've considered

Just break stuff.

Additional context

Priorities

Add 👍 to issues you find important.

@roberth roberth added bug feature Feature request or proposal new-cli Relating to the "nix" command labels Feb 13, 2023
@roberth roberth self-assigned this Feb 20, 2023
@roberth roberth added idea approved The given proposal has been discussed and approved by the Nix team. An implementation is welcome. and removed bug labels Feb 20, 2023
@fricklerhandwerk
Copy link
Contributor

Discussed in Nix team:

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2023-02-17-nix-team-meeting-minutes-33/25624/1

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2023-02-20-nix-team-meeting-minutes-34/25625/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation feature Feature request or proposal idea approved The given proposal has been discussed and approved by the Nix team. An implementation is welcome. new-cli Relating to the "nix" command
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants