resolve-api-to-query

Generate TypeScript QueryParameter classes from OpenAPI JSON and YAML specs.

1|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/riease/vue-backend-template --skill resolve-api-to-query
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: resolve-api-to-query
Source: https://github.com/riease/vue-backend-template/tree/main/.agent/skills/resolve-api-to-query
Command: npx skills add https://github.com/riease/vue-backend-template --skill resolve-api-to-query

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires lodash, js-yaml, glob, and includes scripts (resource) components.

What problem does it solve?

OpenAPI specs are often large and complex; manually creating TypeScript QueryParameter classes is repetitive and error-prone. This skill automates the generation of a project-specific base class and per-endpoint subclasses in a single file, ensuring consistency across the API layer.

Core Features & Use Cases

  • Generate a base QueryParameter class that supports common query params and a mechanism to include keyword-based filtering.
  • Create endpoint-specific subclasses derived from the base class, with properties for endpoint query parameters, and sensible defaults for sorting.
  • Produce a documentation note at doc/note/query.md outlining common and specific parameters for easy reference.

Quick Start

Run the generation script to create base and endpoint query parameter classes from your OpenAPI specs.

Frequently Asked Questions about resolve-api-to-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate TypeScript query parameter classes from an OpenAPI spec?

Generating TypeScript query parameter classes from an OpenAPI spec is done by analyzing JSON or YAML files to derive a base class and endpoint-specific subclasses using operationId and path definitions, ensuring consistent API layer typing.

How do I exclude common query parameters from individual endpoint subclasses in OpenAPI code generation?

Excluding common query parameters from endpoint subclasses is handled automatically by creating a shared base class for common parameters while isolating endpoint-specific query properties in the derived subclasses.

Can I use a script to parse both JSON and YAML OpenAPI specifications for TypeScript code generation?

Yes, you can parse both JSON and YAML OpenAPI specifications for TypeScript code generation; the script uses js-yaml to read YAML and processes JSON to transform operation definitions into typed query parameter classes.

What is the best way to automate default sorting configuration in generated TypeScript API query classes?

Automating default sorting configuration is achieved by running a code generation script that embeds sensible sorting defaults directly into the generated endpoint-specific query parameter subclasses.

Does the generated TypeScript query parameter class output include API documentation?

Yes, the generated output includes API documentation; the script automatically creates a validation note at doc/note/query.md outlining common and specific parameters for easy developer reference.