typelevel / typelevel/jawn

How does one convert JSON object with list into something iterable?

Open
#50 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
436
Forks
72
Avg merge
1h 44m
Merged PRs (30d)
1

Description

I know I can access each indexing e.g. .get(0) but how do I iterate over it?

val list = jawn.ast.JParser.parseFromString("""{"stuff": [1,2,3]}""").get
val stuff = list.get("stuff")
for (item <- stuff) println(item)

Contributor guide

Open the contributing guide

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 with jawn.ast.JParser.parseFromString and the subsequent get calls shown in the example, then read the AST API to determine how list values are intended to be traversed. Done means the supported iteration usage is clear and documented, or the needed API change has a defined scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
backend-api-design
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.