Groovy YAML support

classic Classic list List threaded Threaded
11 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Groovy YAML support

Paolo Di Tommaso
Hi, 

I was wondering what's the state of the support of YAML in Groovy

Is there a built-in parser? or do you have any suggestions for a library that works better with Groovy ? 


Cheers,
Paolo
Reply | Threaded
Open this post in threaded view
|

Re: Groovy YAML support

Cédric Champeau
A built-in parser for a whitespace, indent based language? Erf!

More seriously, no, there's no such thing in Groovy, and no idea what libs would be particularly well suited.

2016-04-18 12:41 GMT+02:00 Paolo Di Tommaso <[hidden email]>:
Hi, 

I was wondering what's the state of the support of YAML in Groovy

Is there a built-in parser? or do you have any suggestions for a library that works better with Groovy ? 


Cheers,
Paolo

Reply | Threaded
Open this post in threaded view
|

Re: Groovy YAML support

Bob Brown
In reply to this post by Paolo Di Tommaso
Spring Boot uses snakeyaml: www.snakeyaml.org.


I have used this with groovy (directly and via SB) and it works perfectly.

BOB

---
Bob Brown
Director, Transentia Pty. Ltd.
Training, consulting, development at the leading edge of technology.

    73 Frasers Rd.                Mobile: 0416-078-813
    Ashgrove                      Email: [hidden email]
    Brisbane                      Web: www.transentia.com.au
    Queensland 4060
    Australia

NOTE: This email may NOT be taken to constitute an agreement to form a
"prior relationship" or to give "prior affirmative consent" for the
purposes of opt-in mass marketing.

---

"And so with gods and men
 The sheep remain inside their pen,
 Though many times they've seen the way to leave."
 -- Genesis, "Firth of Fith"



On 18 Apr 2016, at 8:41 PM, Paolo Di Tommaso <[hidden email]> wrote:

Hi, 

I was wondering what's the state of the support of YAML in Groovy

Is there a built-in parser? or do you have any suggestions for a library that works better with Groovy ? 


Cheers,
Paolo

Reply | Threaded
Open this post in threaded view
|

Re: Groovy YAML support

Danny Hyun

Snake yaml works quite nicely

On Apr 18, 2016 6:55 AM, "Bob Brown" <[hidden email]> wrote:
Spring Boot uses snakeyaml: www.snakeyaml.org.


I have used this with groovy (directly and via SB) and it works perfectly.

BOB

---
Bob Brown
Director, Transentia Pty. Ltd.
Training, consulting, development at the leading edge of technology.

    73 Frasers Rd.                Mobile: 0416-078-813
    Ashgrove                      Email: [hidden email]
    Brisbane                      Web: www.transentia.com.au
    Queensland 4060
    Australia

NOTE: This email may NOT be taken to constitute an agreement to form a
"prior relationship" or to give "prior affirmative consent" for the
purposes of opt-in mass marketing.

---

"And so with gods and men
 The sheep remain inside their pen,
 Though many times they've seen the way to leave."
 -- Genesis, "Firth of Fith"



On 18 Apr 2016, at 8:41 PM, Paolo Di Tommaso <[hidden email]> wrote:

Hi, 

I was wondering what's the state of the support of YAML in Groovy

Is there a built-in parser? or do you have any suggestions for a library that works better with Groovy ? 


Cheers,
Paolo

Reply | Threaded
Open this post in threaded view
|

Re: Groovy YAML support

Balachandran Sivakumar-2
In reply to this post by Paolo Di Tommaso
Hi,

On Mon, Apr 18, 2016 at 4:11 PM, Paolo Di Tommaso <[hidden email]> wrote:
Hi, 

I was wondering what's the state of the support of YAML in Groovy


     Snake YAML is pretty good. Here is some code that created when I started learning Groovy that you can use to check it out: https://github.com/benignbala/testlink-client/blob/master/src/main/groovy/org/benignbala/testlink/ConfigStore.groovy#L16 . Thanks
 



--
Thank you
Balachandran Sivakumar

Reply | Threaded
Open this post in threaded view
|

Re: Groovy YAML support

Guillaume Laforge
Administrator
Perhaps there's some room for a nice builder and slurper built atop Snake YAML?

On Tue, Apr 19, 2016 at 4:59 AM, Balachandran Sivakumar <[hidden email]> wrote:
Hi,

On Mon, Apr 18, 2016 at 4:11 PM, Paolo Di Tommaso <[hidden email]> wrote:
Hi, 

I was wondering what's the state of the support of YAML in Groovy


     Snake YAML is pretty good. Here is some code that created when I started learning Groovy that you can use to check it out: https://github.com/benignbala/testlink-client/blob/master/src/main/groovy/org/benignbala/testlink/ConfigStore.groovy#L16 . Thanks
 



--
Thank you
Balachandran Sivakumar




--
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Product Ninja & Advocate at Restlet

Reply | Threaded
Open this post in threaded view
|

Re: Groovy YAML support

Paolo Di Tommaso
Thanks for your suggestions. 

@Guillaume Since Groovy has a very good support for Json and Xml, it would make sense to include a built-in support for Yaml as well. 


Cheers,
Paolo


On Tue, Apr 19, 2016 at 10:43 AM, Guillaume Laforge <[hidden email]> wrote:
Perhaps there's some room for a nice builder and slurper built atop Snake YAML?

On Tue, Apr 19, 2016 at 4:59 AM, Balachandran Sivakumar <[hidden email]> wrote:
Hi,

On Mon, Apr 18, 2016 at 4:11 PM, Paolo Di Tommaso <[hidden email]> wrote:
Hi, 

I was wondering what's the state of the support of YAML in Groovy


     Snake YAML is pretty good. Here is some code that created when I started learning Groovy that you can use to check it out: https://github.com/benignbala/testlink-client/blob/master/src/main/groovy/org/benignbala/testlink/ConfigStore.groovy#L16 . Thanks
 



--
Thank you
Balachandran Sivakumar




--
Guillaume Laforge
Apache Groovy committer & PMC Vice-President
Product Ninja & Advocate at Restlet


Reply | Threaded
Open this post in threaded view
|

Re: Groovy YAML support

Russel Winder-3
On Tue, 2016-04-19 at 14:03 +0200, Paolo Di Tommaso wrote:
> Thanks for your suggestions.
>
> @Guillaume Since Groovy has a very good support for Json and Xml, it
> would
> make sense to include a built-in support for Yaml as well.
>

JSON and XML being part of the standard Groovy distribution I can
understand, but why YAML? If YAML, then why not INI, TOML, SDL, etc.?

--
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:[hidden email]
41 Buckmaster Road    m: +44 7770 465 077   xmpp: [hidden email]
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Groovy YAML support

Bob Brown
And why not?

IFF people contribute their work and that work is of high enough standard?

Therein lies the  rub, of course…

My AUD$0.02

BOB

> On 21 Apr 2016, at 5:15 PM, Russel Winder <[hidden email]> wrote:
>
> On Tue, 2016-04-19 at 14:03 +0200, Paolo Di Tommaso wrote:
>> Thanks for your suggestions.
>>
>> @Guillaume Since Groovy has a very good support for Json and Xml, it
>> would
>> make sense to include a built-in support for Yaml as well.
>>
>
> JSON and XML being part of the standard Groovy distribution I can
> understand, but why YAML? If YAML, then why not INI, TOML, SDL, etc.?
>
> --
> Russel.
> =============================================================================
> Dr Russel Winder      t: +44 20 7585 2200   voip: sip:[hidden email]
> 41 Buckmaster Road    m: +44 7770 465 077   xmpp: [hidden email]
> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

Reply | Threaded
Open this post in threaded view
|

Re: Groovy YAML support

Henrik Martin-2
I can see JSON and XML tools being part of Groovy core since it's used
for a plethora of things in many different parts of the ecosystem.
Having worked with Spring Boot for a while, I too found myself having to
search for tools for YAML processing. Like several people have already
suggested, SnakeYaml works fine, so I simply pulled in that jar and used
it. I can see the potential need for more refined stuff on top of that.
I agree that it probably shouldn't be part of the Groovy core API. But
maybe that type of utilities/extras could go into a "groovy-extras" type
jar file? That way it won't bloat the Groovy core, but it would still be
readily available for folks who need it. I'm obviously NOT suggesting
repackaging SnakeYaml and putting it into a Groovy distro jar, but if
someone contributes some useful Groovy code on top of other libraries
that it could go into a separate jar that would be easy to pull in.

Just my SEK 0.02 :-)

/H

On 4/21/16 9:18 AM, Bob Brown wrote:

> And why not?
>
> IFF people contribute their work and that work is of high enough standard?
>
> Therein lies the  rub, of course…
>
> My AUD$0.02
>
> BOB
>
>> On 21 Apr 2016, at 5:15 PM, Russel Winder <[hidden email]> wrote:
>>
>> On Tue, 2016-04-19 at 14:03 +0200, Paolo Di Tommaso wrote:
>>> Thanks for your suggestions.
>>>
>>> @Guillaume Since Groovy has a very good support for Json and Xml, it
>>> would
>>> make sense to include a built-in support for Yaml as well.
>>>
>> JSON and XML being part of the standard Groovy distribution I can
>> understand, but why YAML? If YAML, then why not INI, TOML, SDL, etc.?
>>
>> --
>> Russel.
>> =============================================================================
>> Dr Russel Winder      t: +44 20 7585 2200   voip: sip:[hidden email]
>> 41 Buckmaster Road    m: +44 7770 465 077   xmpp: [hidden email]
>> London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

12