Skip to content

Question: how could I read a raw json content #1755

@WeihanLi

Description

@WeihanLi

I'm trying to read raw JSON text as an option value, but no luck finding an effective way

For example:

[Theory]
[InlineData(@"--raw {""Id"":1,""Name"":""Test""}")]
[InlineData(@"--raw {""""Id"""":1,""""Name"""":""""Test""""}")]
[InlineData(@"--raw '{""Id"":1,""Name"":""Test""}'")]
public void SplitTest(string commandLine)
{
    var args = CommandLineStringSplitter.Instance.Split(commandLine).ToArray();
    Assert.Equal(2, args.Length);
    Assert.Equal("--raw", args[0]);
    Assert.Equal(@"{""Id"":1,""Name"":""Test""}", args[1]);
}

All the cases failed, is there a simple way to read raw json text

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions