openwrt / openwrt/libubox

libubox: add convenience function for adding anonymous strings to array container

Open
#4 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
32
Forks
35
PR merge metrics
No merged PRs in 30d

Description

It's handy to have unnamed strings in array containers, such as network.lan.ports[] in /etc/board.json.

Please add a convenience function to support this, such as:

json_add_anon_string() {
        local cur
        _json_get_var cur JSON_CUR
        _json_add_generic string "" "$1" "$cur"
}

Not sure if it's worth adding a check to see if the cursor is currently in an array or not.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing _json_add_generic helper and related JSON convenience functions. Check how the current cursor is handled for array containers, then verify that anonymous strings can be appended using the requested helper without changing existing named-string behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.