question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLI: how to validate or describe a JSON file?

See original GitHub issue

Overview

Hi, I have this file

[{ "fieldA": "a", "fieldB": 1, "fieldC": "luke" },
{ "fieldA": "b", "fieldB": 7, "fieldC": "sarah" },
{ "fieldA": "a", "fieldB": 18, "fieldC": "ben" }]

If I run frictionless describe input.json, I have

[resource-error] The data resource has an error: cannot extract metadata "input.json" because ""

What I must add to my command?

Thank you


Please preserve this line to notify @roll (lead of this repository)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
rollcommented, Apr 28, 2021

Yea it’s just landed on Pypi (frictionless@4.9)

1reaction
rollcommented, Apr 28, 2021

Hi,

Currently, with JSON/YAML data, it works this way:

extract('data/table.json') # will fail as it detects it to be a resource metadata
extract(path='data/table.json') # will work as we explicitly provide a data path

Since frictionless@4.9, there is the --path argument for the CLI doing to same:

$ frictionless extract data/table.json # will fail as it detects it to be a resource metadata
$ frictionless extract --path data/table.json # will work as we explicitly provide a data path

It was exposed to all of describe/extract/validate

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to validate JSON from the command line on Linux
First, you can validate JSON data against a JSON schema, i.e., checking whether the given JSON data conform to the JSON schema specification....
Read more >
Validate JSON file syntax in shell script without installing any ...
I have yet to find a system where python -mjson.tool doesn't work. So you can do: python -mjson.tool "$somefile" > /dev/null.
Read more >
Validating JSON data in shell scripts with jtd-validate
jtd-validate is a CLI tool that can validate JSON input against a JSON Typedef schema.
Read more >
JSON Validator in Ubuntu 16.04 - command line
Try jsonlint : sudo apt install jsonlint. The basic usage syntax is jsonlint YOUR-FILE.JSON. You find its manual by typing man jsonlint or ......
Read more >
zaach/jsonlint: A JSON parser and validator with a CLI. - GitHub
Install jsonlint with npm to use the command line interface: npm install jsonlint -g. Validate a file like so: jsonlint myfile.json.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found