GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add ultility to construct JsonStructure from raw JSON string · Issue #69 · javaee/json-processing-spec

This repository was archived by the owner on Aug 10, 2023. It is now read-only.
This repository was archived by the owner on Aug 10, 2023. It is now read-only.

Add ultility to construct JsonStructure from raw JSON string #69

Copy link
Copy link
Open
Open
Add ultility to construct JsonStructure from raw JSON string#69
Copy link
Assignees
glassfishrobot
Labels
ERR: AssigneePriority: MinorType: New Feature
Milestone
1.0-next

Description

@glassfishrobot
glassfishrobot
opened on Apr 4, 2015
Issue body actions

Currently, JsonArrayBuilder and JsonObjectBuilder can be used to create JSON object models from scratch. However, the process is cumbersome and verbose. There should be an easier way for doing this.

I am proposing something like the following:

JsonArray a = JsonUtil.getArray(
    "[{'abc': 'xyz', 'ss': 1234}, {'m\\'n': 'l\"m'}]");

Note that I'm using single quotes for JSON strings, otherwise I'll have lots of " as required in Java. I am not proposing allowing single quotes for JSON string (which is not allowed in JSON) in general. This utility will need to convert ' to " before sending it to JsonReader.

Note also \ is used to allow ' or " inside the JSON string, but this is just some details that we should not worry for now.

Such utility will be very useful in writing JSON tests. But it should be useful to JSON users.

Activity

  1. glassfishrobot commented on Apr 4, 2015

    @glassfishrobot
    glassfishrobot
    on Apr 4, 2015
    ContributorAuthor
    More actions

    Reported by kchung

  2. glassfishrobot commented on Apr 4, 2015

    @glassfishrobot
    glassfishrobot
    on Apr 4, 2015
    ContributorAuthor
    More actions

    Was assigned to kchung

  3. glassfishrobot commented on Apr 4, 2015

    @glassfishrobot
    glassfishrobot
    on Apr 4, 2015
    ContributorAuthor
    More actions

    mitemitreski said:
    Single quotes are great idea but we need to make sure somehow that it is clear that this is intended as a helper only and not standards derailing.

    Is JavaDoc enough for this ?

  4. glassfishrobot commented on Apr 6, 2015

    @glassfishrobot
    glassfishrobot
    on Apr 6, 2015
    ContributorAuthor
    More actions

    kchung said:
    We need to be clear that single quotes can only be used in this method. We'll have to do our best in the javadocs, since it the only thing we have for the spec.

  5. glassfishrobot commented on Mar 7, 2017

    @glassfishrobot
    glassfishrobot
    on Mar 7, 2017
    ContributorAuthor
    More actions

    @m0mus said:
    I am not sure that we need it.

  6. glassfishrobot commented on Apr 25, 2017

    @glassfishrobot
    glassfishrobot
    on Apr 25, 2017
    ContributorAuthor
    More actions

    This issue was imported from java.net JIRA JSON_PROCESSING_SPEC-69

  7. glassfishrobot
    added
    Type: New Feature
    Priority: Minor
    ERR: Assignee
    on Apr 25, 2017
  8. glassfishrobot
    added this to the 1.0-next milestone on Apr 25, 2017
  9. glassfishrobot
    self-assigned this
    on Apr 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @glassfishrobot
    glassfishrobot

Labels

ERR: AssigneePriority: MinorType: New Feature

Type

No type

Projects

No projects

    Milestone

    • 1.0-nextNo due date

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.