Skip to content

Plugin not converting properly from .properties to JSON #98

@aepedraza

Description

@aepedraza

📝 Issue Description

Tried the plugin in IntelliJ IDEA Community and it's not converting properly. I'm usingt this properties file as input:

ai.at
ai.oi
ai.p
am
cd
epi
id
ig
ii
pg
pi
pm.b
pm.chdn
pm.chn
pm.ct
pm.ip.hi
pm.ip.ia.c[].a.v
pm.ip.ipti
pm.ip.i
pm.ip.ipgi
pm.ip.ir
pm.ip.igp
pm.ip.mc
pm.ip.pi
pm.ip.ta.c
pm.ip.ta.v
pm.ip.tfc
pm.i3
pm.iic
pm.i
pm.l
pm.n
pm.p
pm.pi
pm.type
pr.id
pt
s.bi
s.o.ti
s.pi
s.n
tav
t[].a.c
t[].a.v
t[].ad.arn
t[].ad.c
t[].p[].d
t[].p[].n
t[].p[].q
t[].p[].up.c
t[].p[].up.v
t[].sd
t[].s
w.n

I'm expecting to get something like:

{
  "ai": {
    "at": "",
    "oi": "",
    "p": ""
  },
  "am": "",
  ...
  "t": [
    {
      "a": {
        "c": ""
        ...
      }
    }
  ],
  ...
}

but instead I'm getting an empty array:

[]

What I'm doing is:

  1. Open file
  2. Select all
  3. Right click > JSON Assistant > Convert to... > JSON

Tried adding an index to the array elements (e.g. t[0] instead of t[]) but the result is similar. Also tried adding = at the end of each line (like empty properties) but I'm not getting the JSON Assistant option with the Right click. Am I using the plugin properly?

Thanks in advance

🏷 Plugin Version

1.8.2

💻 IDE and Operating Environment

IntelliJ IDEA 2024.3 (Community Edition)
Build #IC-243.21565.193, built on November 12, 2024
Runtime version: 21.0.5+8-b631.16 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 11.0
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2048M
Cores: 20
Registry:
  ide.experimental.ui=true
  i18n.locale=
  terminal.new.ui=true
Non-Bundled Plugins:
  GenerateSerialVersionUID (3.0.3)
  String Manipulation (9.15.0)
  Lombook Plugin (243.21565.193)
  org.sonarlint.idea (10.24.0.81420)
  cn.memoryzy.json (1.8.2)
Kotlin: 243.21565.193-IJ

📋 Stacktrace


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions