jqschema

Featured

Infer JSON structure and types with jq-based schema discovery.

API & Backend 4,523 stars 402 forks Updated today MIT

Install

View on GitHub

Quality Score: 94/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

## jqschema - JSON Schema Discovery Use `./.github/skills/jqschema/jqschema.sh` directly from the repository skill folder to discover complex JSON structure. ### Purpose Generate a compact structural schema (keys + types) from JSON input. Use it when: - Analyzing tool outputs from GitHub search (search_code, search_issues, search_repositories) - Exploring API responses with large payloads - Understanding the structure of unfamiliar data without verbose output - Planning queries before fetching full data ### Usage ```bash # Analyze a file cat data.json | ./.github/skills/jqschema/jqschema.sh # Analyze command output echo '{"name": "test", "count": 42, "items": [{"id": 1}]}' | ./.github/skills/jqschema/jqschema.sh # Analyze GitHub search results gh api search/repositories?q=language:go | ./.github/skills/jqschema/jqschema.sh ``` ### How It Works The script transforms JSON data by: 1. Replacing object values with their type names ("string", "number", "boolean", "null") 2. Reducing arrays to their first element's structure (or empty array if empty) 3. Recursively processing nested structures 4. Outputting compact (minified) JSON ### Example **Input:** ```json { "total_count": 1000, "items": [ {"login": "user1", "id": 123, "verified": true}, {"login": "user2", "id": 456, "verified": false} ] } ``` **Output:** ```json {"total_count":"number","items":[{"login":"string","id":"number","verified":"boolean"}]} ``` ### Best Practices **Use this script when:** ...

Details

Author
github
Repository
github/gh-aw
Created
9 months ago
Last Updated
today
Language
Go
License
MIT

Related Skills