cli: verification of project for json errors only
An `xyz.radicle.project` payload is allowed to not be defined, so report the error if the project resulted in a JSON error.
This commit is contained in:
parent
f9c3523183
commit
c6d975799a
|
|
@ -74,5 +74,5 @@ Note that we cannot delete mandatory fields:
|
|||
|
||||
``` (fails)
|
||||
$ rad id update --title "Delete default branch" --payload xyz.radicle.project defaultBranch null
|
||||
✗ Error: failed to verify `xyz.radicle.project`, json: missing field `defaultBranch`
|
||||
✗ Error: failed to verify `xyz.radicle.project`, missing field `defaultBranch`
|
||||
```
|
||||
|
|
|
|||
|
|
@ -460,13 +460,13 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
|
|||
anyhow::bail!("payload `{id}` not found in identity document");
|
||||
}
|
||||
}
|
||||
// Verify that the project payload can still be parsed into the
|
||||
// `Project` type.
|
||||
if let Err(e) = proposal.project() {
|
||||
anyhow::bail!("failed to verify `xyz.radicle.project`, {e}");
|
||||
}
|
||||
proposal
|
||||
};
|
||||
// Verify that the project payload can still be parsed into the
|
||||
// `Project` type.
|
||||
if let Err(PayloadError::Json(e)) = proposal.project() {
|
||||
anyhow::bail!("failed to verify `xyz.radicle.project`, {e}");
|
||||
}
|
||||
let proposal = proposal.verified()?;
|
||||
if proposal == current.doc {
|
||||
if !options.quiet {
|
||||
|
|
|
|||
Loading…
Reference in New Issue