openapi-parser

Parse OpenAPI 3.x specs and translate polymorphic schemas into Drift test blocks.

6|3|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/pactflow/pactflow-agent-skills --skill openapi-parser-pactflow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openapi-parser
Source: https://github.com/pactflow/pactflow-agent-skills/tree/main/plugins/swagger-contract-testing/skills/openapi-parser
Command: npx skills add https://github.com/pactflow/pactflow-agent-skills --skill openapi-parser-pactflow

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

OpenAPI specs often embed complex polymorphic patterns such as oneOf, anyOf, and discriminator, along with extensive $ref chains. This skill analyzes those patterns and translates them into Drift test blocks, enabling automated test generation from API schemas.

Core Features & Use Cases

  • Interpret polymorphic patterns in OpenAPI specs and enumerate deterministic test variants.
  • Map schemas to Drift operations with dataset guidance and explicit discriminator handling.
  • Output Drift YAML blocks and optional dataset definitions for scalable, repeatable API testing.

Quick Start

Analyze a provided OpenAPI spec to generate Drift tests for its polymorphic endpoints.

Frequently Asked Questions about openapi-parser

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

FAQPage Schema
How do I generate Drift tests from OpenAPI specs with polymorphic schemas?

To generate Drift tests from OpenAPI specs, parse the file to translate polymorphic oneOf, anyOf, allOf, and discriminator patterns into deterministic Drift test blocks. It resolves $ref references and enumerates viable response variants with appropriate datasets.

What are OpenAPI schema drift tests and when do I need them?

OpenAPI schema drift tests are automated test blocks generated from complex API schemas to validate contract adherence. You need them when your API uses polymorphic patterns like oneOf or anyOf, requiring deterministic variant enumeration to validate responses against the defined schema.

How do I handle OpenAPI discriminator and allOf patterns when creating API tests?

Handle OpenAPI discriminator and allOf patterns by parsing the spec to map schemas to Drift operations with explicit discriminator handling. The parser enumerates viable test variants across responses and outputs Drift operations YAML alongside optional dataset definitions.

Does the openapi-parser resolve $ref references when generating test cases?

Yes, the openapi-parser resolves $ref references when generating test cases. It traverses extensive $ref chains within the OpenAPI 3.x spec to accurately interpret polymorphic patterns and enumerate deterministic test variants for the Drift operations YAML output.

What are the limitations of generating Drift tests from OpenAPI 3.x specs?

A limitation of generating Drift tests from OpenAPI 3.x specs is that certain viable variants may be intentionally omitted. The parser outputs notes identifying these gaps where specific polymorphic variants are excluded from the generated Drift operations YAML and datasets.