Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty YAML object causes format deserialize to fail #92

Closed
BernieWhite opened this issue Feb 25, 2019 · 0 comments
Closed

Empty YAML object causes format deserialize to fail #92

BernieWhite opened this issue Feb 25, 2019 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@BernieWhite
Copy link
Member

Description of the issue

When an empty object is passed to -InputObject when using the YAML input format (-Format Yaml) an exception is generated.

Consider:

---
metadata:
  name: anObject
---
# Commented out object
# metadata:
#   name: anObject2
---

To Reproduce

Steps to reproduce the issue:

Invoke-PSRule -InputObject (Get-Content -Path .\anObject.yaml -Raw | Out-String) -Format Yaml;

Expected behaviour

Empty objects should be ignored.

Error output

(Line: 10, Col: 4, Idx: 161) - (Line: 8, Col: 4, Idx: 161): Expected 'DocumentEnd', got 'Scalar' (at Line: 8, Col: 4, Idx: 161).

Module in use and version:

  • Module: PSRule
  • Version: 0.3.0-B190224

Captured output from $PSVersionTable:

Name                           Value
----                           -----
PSVersion                      5.1.17763.316
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.316
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
@BernieWhite BernieWhite added the bug Something isn't working label Feb 25, 2019
@BernieWhite BernieWhite added this to the v0.3.0 milestone Feb 25, 2019
@BernieWhite BernieWhite self-assigned this Feb 25, 2019
@BernieWhite BernieWhite changed the title Empty yaml object causes YAML format deserialization to fail Empty YAML object causes format deserialize to fail Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant