You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Stefan Seifert <ss...@pro-vision.de> on 2017/02/20 22:17:40 UTC
[utils] support comments in JSONOParser?
the new json parser added to Felix Utils fails when the JSON files contain comments like /* comment */.
i known that the JSON format [1] officially does not support comments at all, but most JSON parsers nowadays seem to support them by just skipping comments when parsing a JSON file. should the felix parser support this as well? perhaps configurable via a strict and non-strict mode?
stefan
[1] https://tools.ietf.org/html/rfc7159
Re: [utils] support comments in JSONOParser?
Posted by Felix Meschberger <fm...@adobe.com>.
Hi
I tend to agree with this …
plus: that project even implements the standard javax.json API…
Regards
Felix
> Am 21.02.2017 um 09:06 schrieb Achim Nierbeck <bc...@googlemail.com>:
>
> Hi,
>
> I wouldn't do it, in the end you'll endup re-inventing the wheel a 50th
> time.
> If you think the minimum parser isn't sufficient, it's time to think of
> using another one.
> As I already pointed out previously we do have an apache project for JSON
> stuff.
> At this point if it is really needed and not a simple string parsing and
> done with it.
> Go for a full featured JSON lib, which is already OSGi ready.
>
> regards, Achim
>
> 2017-02-21 0:42 GMT+01:00 David Leangen <os...@leangen.net>:
>
>>
>> Agree that it would be a very nice feature to have.
>>
>> HOWEVER, this is how the scope creep starts. The original thought was to
>> have a very simple parser.
>>
>>
>> What about a separate (possibly even configurable) pre-parser instead?
>>
>>
>> Cheers,
>> =David
>>
>>
>>> On Feb 21, 2017, at 7:17 AM, Stefan Seifert <ss...@pro-vision.de>
>> wrote:
>>>
>>> the new json parser added to Felix Utils fails when the JSON files
>> contain comments like /* comment */.
>>>
>>> i known that the JSON format [1] officially does not support comments at
>> all, but most JSON parsers nowadays seem to support them by just skipping
>> comments when parsing a JSON file. should the felix parser support this as
>> well? perhaps configurable via a strict and non-strict mode?
>>>
>>> stefan
>>>
>>> [1] https://tools.ietf.org/html/rfc7159
>>>
>>>
>>
>>
>
>
> --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
Re: [utils] support comments in JSONOParser?
Posted by Carsten Ziegeler <cz...@apache.org>.
+1
I think the objective of the parser in utils is for really simple
parsing/simple use cases. We should not add additional features.
Carsten
Achim Nierbeck wrote
> Hi,
>
> I wouldn't do it, in the end you'll endup re-inventing the wheel a 50th
> time.
> If you think the minimum parser isn't sufficient, it's time to think of
> using another one.
> As I already pointed out previously we do have an apache project for JSON
> stuff.
> At this point if it is really needed and not a simple string parsing and
> done with it.
> Go for a full featured JSON lib, which is already OSGi ready.
>
> regards, Achim
>
> 2017-02-21 0:42 GMT+01:00 David Leangen <os...@leangen.net>:
>
>>
>> Agree that it would be a very nice feature to have.
>>
>> HOWEVER, this is how the scope creep starts. The original thought was to
>> have a very simple parser.
>>
>>
>> What about a separate (possibly even configurable) pre-parser instead?
>>
>>
>> Cheers,
>> =David
>>
>>
>>> On Feb 21, 2017, at 7:17 AM, Stefan Seifert <ss...@pro-vision.de>
>> wrote:
>>>
>>> the new json parser added to Felix Utils fails when the JSON files
>> contain comments like /* comment */.
>>>
>>> i known that the JSON format [1] officially does not support comments at
>> all, but most JSON parsers nowadays seem to support them by just skipping
>> comments when parsing a JSON file. should the felix parser support this as
>> well? perhaps configurable via a strict and non-strict mode?
>>>
>>> stefan
>>>
>>> [1] https://tools.ietf.org/html/rfc7159
>>>
>>>
>>
>>
>
>
--
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org
Re: [utils] support comments in JSONOParser?
Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,
I wouldn't do it, in the end you'll endup re-inventing the wheel a 50th
time.
If you think the minimum parser isn't sufficient, it's time to think of
using another one.
As I already pointed out previously we do have an apache project for JSON
stuff.
At this point if it is really needed and not a simple string parsing and
done with it.
Go for a full featured JSON lib, which is already OSGi ready.
regards, Achim
2017-02-21 0:42 GMT+01:00 David Leangen <os...@leangen.net>:
>
> Agree that it would be a very nice feature to have.
>
> HOWEVER, this is how the scope creep starts. The original thought was to
> have a very simple parser.
>
>
> What about a separate (possibly even configurable) pre-parser instead?
>
>
> Cheers,
> =David
>
>
> > On Feb 21, 2017, at 7:17 AM, Stefan Seifert <ss...@pro-vision.de>
> wrote:
> >
> > the new json parser added to Felix Utils fails when the JSON files
> contain comments like /* comment */.
> >
> > i known that the JSON format [1] officially does not support comments at
> all, but most JSON parsers nowadays seem to support them by just skipping
> comments when parsing a JSON file. should the felix parser support this as
> well? perhaps configurable via a strict and non-strict mode?
> >
> > stefan
> >
> > [1] https://tools.ietf.org/html/rfc7159
> >
> >
>
>
--
Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
Software Architect / Project Manager / Scrum Master
Re: [utils] support comments in JSONOParser?
Posted by David Leangen <os...@leangen.net>.
Agree that it would be a very nice feature to have.
HOWEVER, this is how the scope creep starts. The original thought was to have a very simple parser.
What about a separate (possibly even configurable) pre-parser instead?
Cheers,
=David
> On Feb 21, 2017, at 7:17 AM, Stefan Seifert <ss...@pro-vision.de> wrote:
>
> the new json parser added to Felix Utils fails when the JSON files contain comments like /* comment */.
>
> i known that the JSON format [1] officially does not support comments at all, but most JSON parsers nowadays seem to support them by just skipping comments when parsing a JSON file. should the felix parser support this as well? perhaps configurable via a strict and non-strict mode?
>
> stefan
>
> [1] https://tools.ietf.org/html/rfc7159
>
>