Skip to content

Parse fails on lists #49

Open
Open
@wldevries

Description

Describe the Bug

YamlPeek fails when the yaml root is a list

Steps to Reproduce

Feed a list like:

- name: Star Trek
  stuff: yes
- name: Star Wars
  stuff: no

Expected Behavior

parses correctly

Exception with Stack Trace

"MyTarget.targets" (DoStuff target) (1) ->
(EnsureOutputFiles target) ->
  MyTarget.targets(31,5): error MSB4018: The "YamlPeek" task failed unexpectedly.
MyTarget.targets(31,5): error MSB4018: Newtonsoft.Json.JsonReaderException: Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray. Path '', line 1, position 1.
MyTarget.targets(31,5): error MSB4018:    at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
MyTarget.targets(31,5): error MSB4018:    at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
MyTarget.targets(31,5): error MSB4018:    at YamlPeek.Execute() in /_/src/YamlPeek/YamlPeek.cs:line 67
MyTarget.targets(31,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
MyTarget.targets(31,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

Version Info

1.0.0

Additional Info

Back this issue
Back this issue

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions