Questions tagged [snakeyaml]

SnakeYAML is a YAML parser and emitter for the Java programming language.

395 questions
9
votes
2 answers

How to resolve snakeyaml NoSuchMethodError: getStyle()

In my spring boot application, I am using snakeyaml to parse a YAML file. I get the following error though when using the library: java.lang.NoSuchMethodError: org.yaml.snakeyaml.nodes.ScalarNode.getStyle()Ljava/lang/Character; I am using the…
user2035039
  • 961
  • 3
  • 16
  • 30
9
votes
1 answer

snakeyaml and spark results in an inability to construct objects

The following code executes fine in a scala shell given snakeyaml version 1.17 import org.yaml.snakeyaml.Yaml import org.yaml.snakeyaml.constructor.Constructor import scala.collection.mutable.ListBuffer import scala.beans.BeanProperty class…
placeybordeaux
  • 2,138
  • 1
  • 20
  • 42
9
votes
2 answers

Spring Profile include issue with yaml file

I'm trying to accomplish when the team sets the websphere profile active that the cloud profile is also activated. yaml file --- spring: application: name: kicapp output: ansi: enabled: ALWAYS …
ndrone
  • 3,524
  • 2
  • 23
  • 37
8
votes
1 answer

Is snakeyaml 2.0 added in the new Spring boot versions?

I see there is reference to snakeyaml 2.0 in the bugfixes of the new SPringBoot release 3.10-M2 & the older version, but when we look at the source code, we see that the snakeyaml library version is still 1.33 Is there a way to get more information…
Vinod K
  • 1,885
  • 11
  • 35
  • 45
8
votes
2 answers

How to load a list of custom objects with SnakeYaml

I've been trying to deserialize the following yaml to a List using SnakeYaml: - name: Stage1 items: - item1 - item2 - name: Stage2 items: - item3 public class Stage { private String name; private List
Lesiak
  • 22,088
  • 2
  • 41
  • 65
8
votes
4 answers

Duplicate key in YAML configuaration file

I have the following in YAML: key1 key2: "value" key1 key2 key3: "value2" Get exception duplicate key key1. Caused by: org.yaml.snakeyaml.parser.ParserException: while parsing MappingNode Tried various combinations but was unable to parse…
user5591691
8
votes
1 answer

How to parse field name with dash in snakeyaml?

I have fragment of yaml file: field-name: my/data but I can't create pojo with method name setField-name Is there any way to parse such yaml file?
pixel
  • 24,905
  • 36
  • 149
  • 251
8
votes
0 answers

How to load a yaml directly into a Map with SnakeYAML?

I would like to load this file (test.yml): Car1: countriesSold: [Spain, France, Italy] model: Seat specs: {color: black, height: 29, with: 29} Car2: countriesSold: [Germany, France] model: BMW specs: {color: white, height:…
ktulinho
  • 3,870
  • 9
  • 28
  • 35
8
votes
2 answers

How to prevent Spring Boot from parsing YAML keys with dots

I have a YAML configuration file with a map of properties: properties: a.b.c: 1 Boot will parse this as: {a:{b:{c:1}}} However, what I desire is : {'a.b.c': 1} Is there anyway to coax it into "pass through" key mode? Quoting the key doesn't…
btiernay
  • 7,873
  • 5
  • 42
  • 48
8
votes
3 answers

How to hide bean type in snakeyaml

This code will output:(YAML) --- !!org.test.bean.Person address: 4011 16th Ave S ..... Can hide my bean type(org.test.bean.Person) anyway !? (prefer to use snakeyaml config...i can't find it..) thanks!! public static void dumpYAML(){ Constructor…
Laa
  • 393
  • 2
  • 7
7
votes
1 answer

SnakeYAML - Where is documentation and project homepage (is it still alive)?

I'm trying to figure out how to fine control a specific feature in SnakeYaml (local tags). Unfortunately, I seem to be unable to find a project homepage or the repository of Snake Yaml? All references I find point to either a website, that seems to…
Matthias
  • 2,622
  • 1
  • 18
  • 29
7
votes
4 answers

snakeyaml-1.27-android.jar not found error while running tests

./gradlew test Task :compileTestJava FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileTestJava'. > Could not find snakeyaml-1.27-android.jar (org.yaml:snakeyaml:1.27). Searched in the…
Rpj
  • 5,348
  • 16
  • 62
  • 122
7
votes
1 answer

SnakeYaml "Unable to find property error"

Here is part of my config.yml: #Authenctication AuthenticationConfig: AuthencticationType: LDAP LDAPConfig: LDAPUrl: ldap://localhost:389 ConnectionType: simple LDAPSecurityConfig: RootDN: cn=manager,dc=maxcrc,dc=com …
zero_yu
  • 493
  • 5
  • 15
7
votes
1 answer

Snakeyaml - How to have custom control on the flow style

I am trying to create a YAML file in java with snakeyaml, and I have trouble obtaining the format I need. Some of the children are in the correct format when using DumperOptions.FlowStyle.BLOCK, while other parts are in the correct format when using…
Sarah N
  • 518
  • 7
  • 22
7
votes
2 answers

Keep tags order using SnakeYAML

I'm trying to translate yaml files to json, but the translation re-orders the tags... Ex, YAML source: zzzz: b: 456 a: dfff aa: s10: "dddz" s3: eeee bbb: - b1 - a2 snakeYAML produces: { "aa": { "s3": "eeee", "s10":"dddz" }, …
Daniel
  • 71
  • 1
  • 3
1
2
3
26 27