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

Incorrect JSON deserialization of non-object arrays #111

Closed
BernieWhite opened this issue Mar 24, 2019 · 0 comments
Closed

Incorrect JSON deserialization of non-object arrays #111

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

Comments

@BernieWhite
Copy link
Member

BernieWhite commented Mar 24, 2019

Description of the issue

Incorrect deserialization of nested arrays with non-objects. This is related to issue #109.

To Reproduce

Steps to reproduce the issue:

{
    "Properties": {
        "n": [
            "1",
            "2",
            "3"
        ]
    }
}
Rule 'countN' {
    ($TargetObject.properties.n | Measure-Object).Count -ge 3
}

Expected behaviour

The rule should pass, returns an exception Read json failed instead.

Module in use and version:

  • Module: PSRule
  • Version: 0.4.0-B190313

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

Additional context

The issue also affects PSRule v0.3.0.

@BernieWhite BernieWhite added the bug Something isn't working label Mar 24, 2019
@BernieWhite BernieWhite added this to the v0.4.0 milestone Mar 24, 2019
@BernieWhite BernieWhite self-assigned this Mar 24, 2019
BernieWhite added a commit that referenced this issue Mar 24, 2019
- Fix incorrect JSON de-serialization of non-object arrays. #111
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