react-json-editor-ajrm icon indicating copy to clipboard operation
react-json-editor-ajrm copied to clipboard

Display in double-quotes instead of single quotes as per JSON standard

Open kalashnikovisme opened this issue 4 years ago • 2 comments

  1. What version of RJEA are you using (react-json-editor-ajrm version)? *REQUIRED 2.5.9
  2. What operating system and processor architecture are you using? *REQUIRED Linux
  3. What did you do? *REQUIRED I just use it with this code
           <JSONInput id='jsonEditor'
                  locale={locale}
                  width="100%"
                  style={{ body: { 'font-size': '10pt' } } }
                  colors={{
                    default: "#BDAFE7",
                    background: "#F0F2F1",
                    background_warning: "#FFDCDB",
                    string: "#5A12CC",
                    number: "#FF514A",
                    colon: "#5A12CC",
                    keys: "#252844",
                    primitive: "#FF746E"
                  }}
                  placeholder={{ ...buildPlaceholder(params.params) }}
                  onChange={ (changeObject) => change('params', changeObject.json)}
             />

where buildPlaceholder(params.params) returns valid JSobject.

This object

KPI_period_end: "2020-06-01"
KPI_period_start: "2020-07-01"
args_override_profile: false
commited_plan_start: "2020-07-31 23:00"
customer_data_format: "2020-05-29"
customer_name: "Star"
fact_start: "2020-05-01"
free_plan_start: "2020-07-31 23:00"
operation_mode: 0
period_end: "2020-07-31 23:00"
realm: "atr"
realm_profiles: Array(1)
0: "default"
length: 1
__proto__: Array(0)
version: "master"
  1. What did you expect to see? *REQUIRED

I expect to see my object as JSON with quotes

  1. What did you see instead? *REQUIRED

I see this. It's not a valid JSON

https://imgur.com/a/3YrNHPT

kalashnikovisme avatar Aug 01 '20 12:08 kalashnikovisme

Single quotes are intended behavior, however, a strong argument can be made that the expectation is it should match JSON specs.

AndrewRedican avatar Aug 25 '20 09:08 AndrewRedican

I'd like to vote for this one. Having non-compliant JSON makes no sense.

afaianswq avatar Jun 23 '22 13:06 afaianswq

I no longer intend to update this project. I am working instead on a complete rewrite.

I'd like to thank you for using and taking interest in this project.

I also would like to apologize for not following up sooner. However, do realize for the most part this has been a one-man show, and the occasional contributions I used to receive. What I am saying is, I am in dire need of volunteers.

If this is something you would be interested in participating in, you can join in the discussion.

I've taken note of this thread, and I'll keep this under consideration for the new project.

AndrewRedican avatar Jan 29 '23 03:01 AndrewRedican