mirror of
https://github.com/NixOS/nix.git
synced 2025-12-08 18:11:02 +01:00
Introduce --json-format for nix path-info
As discussed today at great length in the Nix meeting, we don't want to break the format, but we also don't want to impede the improvement of JSON formats. The solution is to add a new flag for control the output format. Note that prior to the release, we may want to replace `--json --json-format N` with `--json=N`, but this is being left for a separate PR, as we don't yet have `=` support for CLI flags.
This commit is contained in:
parent
69920f9557
commit
1ad13a1423
36 changed files with 464 additions and 132 deletions
|
|
@ -1 +0,0 @@
|
|||
../../../../../../src/libstore-tests/data/nar-info
|
||||
1
doc/manual/source/protocols/json/schema/nar-info-v2
Symbolic link
1
doc/manual/source/protocols/json/schema/nar-info-v2
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../../../../src/libstore-tests/data/nar-info/json-2
|
||||
|
|
@ -1 +1 @@
|
|||
../../../../../../src/libstore-tests/data/path-info
|
||||
../../../../../../src/libstore-tests/data/path-info/json-2
|
||||
|
|
@ -63,7 +63,7 @@ $defs:
|
|||
- Version 2: Use structured JSON type for `ca`
|
||||
|
||||
path:
|
||||
type: string
|
||||
"$ref": "./store-path-v1.yaml"
|
||||
title: Store Path
|
||||
description: |
|
||||
[Store path](@docroot@/store/store-path.md) to the given store object.
|
||||
|
|
@ -89,7 +89,7 @@ $defs:
|
|||
description: |
|
||||
An array of [store paths](@docroot@/store/store-path.md), possibly including this one.
|
||||
items:
|
||||
type: string
|
||||
"$ref": "./store-path-v1.yaml"
|
||||
|
||||
ca:
|
||||
oneOf:
|
||||
|
|
@ -128,7 +128,9 @@ $defs:
|
|||
references: { $ref: "#/$defs/base/properties/references" }
|
||||
ca: { $ref: "#/$defs/base/properties/ca" }
|
||||
deriver:
|
||||
type: ["string", "null"]
|
||||
oneOf:
|
||||
- "$ref": "./store-path-v1.yaml"
|
||||
- type: "null"
|
||||
title: Deriver
|
||||
description: |
|
||||
If known, the path to the [store derivation](@docroot@/glossary.md#gloss-store-derivation) from which this store object was produced.
|
||||
|
|
|
|||
|
|
@ -29,13 +29,13 @@
|
|||
### NAR info (minimal)
|
||||
|
||||
```json
|
||||
{{#include schema/nar-info-v1/pure.json}}
|
||||
{{#include schema/nar-info-v2/pure.json}}
|
||||
```
|
||||
|
||||
### NAR info (with binary cache fields)
|
||||
|
||||
```json
|
||||
{{#include schema/nar-info-v1/impure.json}}
|
||||
{{#include schema/nar-info-v2/impure.json}}
|
||||
```
|
||||
|
||||
<!-- need to convert YAML to JSON first
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue