6

I have a .yml file open in Netbeans 8.1 which looks like the following:

---
rules: 
  - !tp.aoi.topology.TopologyRule
    labels:
       - empty_A
    output:
       - entry_B

Netbeans has a squiggly red line under the - !tp.aoi.topology.TopologyRule line and spits out the following:

We had this mapping values are not allowed here 

What causes this error? The grammar of this phrase is nonsensical to me. If I remove the tag, there aren't any problems. From what I understand of YAML from the spec, this should be valid YAML (see the examples on "primary tag handles" under section 6.18), also this section of the spec under section 2.24 "Global Tags".

There are no tabs in this document, only spaces.

I'm fairly certain that I've opened this exact same file with an earlier version of NetBeans on Windows (I'm currently on Ubuntu) without any problems, but I may have also been using some other YAML plugins.

What is causing this error? I've tried other parsers, and this seems to be valid. From another post on SO, it seems that this is often related to missing a space between both sides of a mapping; this doesn't appear to be my issue.

Community
  • 1
  • 1
karobar
  • 1,250
  • 8
  • 30
  • 61
  • The code shown here has a space before `---` and the subsequent line. Does your actual YAML file also have these spaces? If so, they make the YAML invalid because the `---` is interpreted as a scalar (string) instead of a document start indicator, and a mapping can't follow a scalar like that. If your actual file *doesn't* have the spaces, then this is very puzzling indeed. – Jordan Running Jan 24 '16 at 05:22
  • Thanks, I didn't notice that. It was simply my error in copying the text into my question. The actual file doesn't have those spaces. I've corrected the question. – karobar Jan 24 '16 at 15:35
  • Looks like this may be a bug, https://netbeans.org/bugzilla/show_bug.cgi?id=251407 – Gary Jul 27 '16 at 03:34
  • Yeah, that's what I was afraid of. From some searching, it seems that this error has been resolved in different circumstances, though, so I've not given up hope. – karobar Jul 27 '16 at 03:38

1 Answers1

2

This is a known bug: see the netbeans bugtracker here

Gary
  • 1,086
  • 2
  • 13
  • 39