jackson-dataformats-text icon indicating copy to clipboard operation
jackson-dataformats-text copied to clipboard

INI Support

Open tisonkun opened this issue 2 years ago • 4 comments

Hi @cowtowncoder!

I can see https://github.com/FasterXML/jackson-dataformat-ini archived and there is no INI support yet.

I meet a requirement to add such support and would like to take a look if I can make something as a starting point.

Do you have more information what you have already done that I can refer to?

tisonkun avatar Jan 04 '24 02:01 tisonkun

Hi @tisonkun! It would be great to get support for .ini files.

Unfortunately I never started implementation, so the archived project skeleton is all there is. So unfortunately there isn't much. As far as formats go, TOML might be closest of supported ones but I suspect implementation here might not work as a starting point either. You might find some ideas from properties format backend here; and/or possibly CSV.

cowtowncoder avatar Jan 04 '24 04:01 cowtowncoder

@cowtowncoder Thanks for your information :D

My original motivation is to support parsing Git config files. I spent some time on it, and noticed that INI doesn't have a spec but many tribal rules .. I implement https://github.com/tisonspieces/git-scm/pull/5 for most of what Git config file works.

May or may not I'll try to implement a basic version for Jackson in this repo, but it's not a blocker to me now >_<

tisonkun avatar Jan 04 '24 06:01 tisonkun

@tisonkun Ok, that makes sense. Too bad wrt lack of specs; although TBH that is quite similar for CSV too, for example.

I would like to see a Jackson backend, of course, but it is not trivial undertaking so I understand why you might not want to start such a project :)

cowtowncoder avatar Jan 05 '24 02:01 cowtowncoder

Also forgot to mention one possible challenge: mapping between INI files logical structure, and Jackson's token stream (basically set of tokens that can represent JSON logical structure, although there are some ways to extend it). This was resolved for TOML so it's probably not insurmountable, but can be tricky or cumbersome; and at very least requires some thought.

cowtowncoder avatar Jan 05 '24 02:01 cowtowncoder