DDT.Packages.JsonPicker 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package DDT.Packages.JsonPicker --version 1.0.0
NuGet\Install-Package DDT.Packages.JsonPicker -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DDT.Packages.JsonPicker" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DDT.Packages.JsonPicker --version 1.0.0
#r "nuget: DDT.Packages.JsonPicker, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DDT.Packages.JsonPicker as a Cake Addin
#addin nuget:?package=DDT.Packages.JsonPicker&version=1.0.0

// Install DDT.Packages.JsonPicker as a Cake Tool
#tool nuget:?package=DDT.Packages.JsonPicker&version=1.0.0

Description

This tool can be used to pick properties from a json element based on another json element as a reference to what should be picked.

Usage

Regular properties

You don't need to set a value for the property just it's name

Example

Element to pick properties from

{
    "name":"ali",
    "age":12
}

Lookup json element

{
    "age":""
}

Result json element

{
    "age":12
}

Object properties

You have to define what properties should be picked from it

Example

Element to pick properties from

{
    "name":"ali",
    "age":12,
    "address":{
        "building":13,
        "street":"21 jumpstreet",
        "city":"cairo",
        "country":"Egypt"
    }
}

Lookup json element

{
    "name":"",
    "address":{
        "street":"",
        "city":"cairo"
    }
}

Result json element

{
    "name":"ali",
    "address":{
        "street":"21 jumpstreet",
        "city":"cairo"
    }
}

Array properties

You have to define what properties should be picked from it's elements

Example

Element to pick properties from

{
    "name":"ali",
    "age":12,
    "books":[
        {
            "title":"Management for dummies",
            "author":"Mahfouz",
            "price":341.32
        },
        {
            "title":"Programming for dummies",
            "author":"Hany",
            "price":32.12
        }
    ]
}

Lookup json element

{
    "age":"",
    "books":{
            "title":"",
            "author":"",
        }
}

Result json element

{
    "age":12,
    "books":[
        {
            "title":"Management for dummies",
            "author":"Mahfouz"
        },
        {
            "title":"Programming for dummies",
            "author":"Hany"
        }
    ]
}

Depth

You can go as deep as you wish

Example

Element to pick properties from

{
    "name":"ali",
    "age":12,
    "books":[
        {
            "title":"Management for dummies",
            "price":341.32,
            "author":{
                "name":"Mahfouz",
                "age":1000,
                "addresses":[
                    {
                        "building":13,
                        "street":"21 jumpstreet",
                        "city":"cairo",
                        "country":"Egypt"
                    }
                ]
            }
        },
        {
            "title":"Programming for dummies",
            "price":32.12,
            "author":{
                "name":"Hany",
                "age":152,
                "addresses":[
                    {
                        "building":16,
                        "street":"65 jumpstreet",
                        "city":"Alex",
                        "country":"USA"
                    }
                ]
            }
        }
    ]
}

Lookup json element

{
    "name": "",
    "books": {
        "author": {
            "name": "",
            "addresses": {
                "building": "",
                "country": ""
            }
        }
    }
}

Result json element

{
    "name": "ali",
    "books": [
        {
            "author": {
                "name": "Mahfouz",
                "addresses": [
                    {
                        "building": 13,
                        "country": "Egypt"
                    }
                ]
            }
        },
        {
            "author": {
                "name": "Hany",
                "addresses": [
                    {
                        "building": 16,
                        "country": "USA"
                    }
                ]
            }
        }
    ]
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.2 1,125 2/6/2023
1.1.1 353 12/21/2022
1.0.0 311 11/15/2022