Skip to content

doc: Update json handling specification in workflow.rst#21244

Merged
choppsv1 merged 1 commit intoFRRouting:masterfrom
donaldsharp:workflow_update_for_json
Mar 24, 2026
Merged

doc: Update json handling specification in workflow.rst#21244
choppsv1 merged 1 commit intoFRRouting:masterfrom
donaldsharp:workflow_update_for_json

Conversation

@donaldsharp
Copy link
Copy Markdown
Member

Community members keep creating json output that includes warning or error if the specified data does not exist. Add a bit more verbiage to also specifically call out error situations as well.

Community members keep creating json output that includes
`warning` or `error` if the specified data does not exist.
Add a bit more verbiage to also specifically call out error
situations as well.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 18, 2026

Greptile Summary

This PR updates the JSON handling specification in doc/developer/workflow.rst to clarify that commands outputting JSON should return an empty object ({}) not only when there is nothing to display, but also when an error occurs with the input. This addresses a recurring pattern in the community where contributors add warning or error fields to JSON output for missing data instead of returning {}.

  • The change is a one-line documentation update in the developer workflow guide.
  • The intent is clear and the guidance is a worthwhile addition to prevent inconsistent error handling in JSON output.
  • There is a typo on the modified line: ocurrs should be occurs.

Confidence Score: 4/5

  • Safe to merge after fixing the spelling error — documentation-only change with no functional impact.
  • The change is a single-line documentation update with clear intent and good guidance for contributors. The only issue is a typo ("ocurrs" instead of "occurs") which should be corrected before merging.
  • doc/developer/workflow.rst — contains a typo on the modified line.

Important Files Changed

Filename Overview
doc/developer/workflow.rst Documentation update clarifying that JSON commands should return {} on error conditions, not just when there's no data to display. Contains a minor spelling error: "ocurrs" should be "occurs".

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[JSON CLI Command Invoked] --> B{Input valid?}
    B -- No --> E[Output empty JSON object]
    B -- Yes --> C{Data available?}
    C -- No --> E
    C -- Yes --> D[Output populated JSON object]
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: doc/developer/workflow.rst
Line: 1664

Comment:
**Typo: "ocurrs" should be "occurs"**

The word `ocurrs` is misspelled — it should be `occurs` (one `c`, two `r`s is wrong; it's one `c`, one `r`).

```suggestion
  display or if an error occurs with the input.
```

How can I resolve this? If you propose a fix, please make it concise.

Last reviewed commit: "doc: Update json han..."

example "router-id" becomes "routerId"
* Commands which output JSON should produce ``{}`` if they have nothing to
display
display or if an error ocurrs with the input.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Typo: "ocurrs" should be "occurs"

The word ocurrs is misspelled — it should be occurs (one c, two rs is wrong; it's one c, one r).

Suggested change
display or if an error ocurrs with the input.
display or if an error occurs with the input.
Prompt To Fix With AI
This is a comment left during a code review.
Path: doc/developer/workflow.rst
Line: 1664

Comment:
**Typo: "ocurrs" should be "occurs"**

The word `ocurrs` is misspelled — it should be `occurs` (one `c`, two `r`s is wrong; it's one `c`, one `r`).

```suggestion
  display or if an error occurs with the input.
```

How can I resolve this? If you propose a fix, please make it concise.

@donaldsharp
Copy link
Copy Markdown
Member Author

ci:rerun

Copy link
Copy Markdown
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@choppsv1 choppsv1 merged commit 626a93a into FRRouting:master Mar 24, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants