openapi

Regenerate Phoenix OpenAPI specifications from OpenApiSpex code to prevent spec drift.

1|Updated May 7, 2026
One-click install
npx skills add https://github.com/agoodway/GoodSkills --skill openapi-agoodway
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openapi
Source: https://github.com/agoodway/GoodSkills/tree/main/skills/openapi
Command: npx skills add https://github.com/agoodway/GoodSkills --skill openapi-agoodway

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Keeps Phoenix applications using open_api_spex from drifting out of sync by regenerating the OpenAPI specification directly from live controller operations and schema modules.

Core Features & Use Cases

  • Spec regeneration from code: Rebuilds openapi.json or openapi.yaml based on your ApiSpec module, controller operation definitions, and OpenApiSpex schema modules.
  • Workflow-aligned output: Detects which spec format exists in the project root and regenerates accordingly (or both if both exist), then helps you review changes via diffs.
  • Common failure guidance: Surfaces compilation errors and highlights likely causes of missing endpoints (e.g., controller actions without OpenApiSpex.operation metadata).

Quick Start

Ask the AI to regenerate your OpenAPI spec by running the OpenAPI regenerate workflow for your Phoenix app, updating the existing openapi.json or openapi.yaml in the project root.

Frequently Asked Questions about openapi

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

FAQPage Schema
How do I regenerate OpenAPI specs in Phoenix after updating controller operations?

To regenerate OpenAPI specs in Phoenix, locate your OpenApiSpex ApiSpec module and run mix openapi.spec.json or mix openapi.spec.yaml. This rebuilds the specification directly from your updated controller operations and schema modules to eliminate documentation drift.

Why does my open_api_spex spec drift out of sync with my Phoenix code?

Spec drift occurs when you change controller actions or OpenApiSpex schema modules without regenerating the published openapi.json or openapi.yaml file. Regenerating the specification directly from the live ApiSpec implementation ensures your documentation matches your current codebase.

Does the openapi spec regeneration workflow output both JSON and YAML formats?

The OpenAPI spec regeneration workflow detects which format exists in your project root. It regenerates openapi.json, openapi.yaml, or both if both files are present, selecting the appropriate mix openapi.spec command based on your existing files.

How do I fix missing endpoints in my regenerated Phoenix OpenAPI specification?

Missing endpoints in a regenerated Phoenix OpenAPI specification are typically caused by controller actions lacking OpenApiSpex.operation metadata. The regeneration process surfaces compilation errors and highlights these likely causes so you can add the missing operation definitions.

What's the best way to validate changes after regenerating an OpenAPI spec from open_api_spex?

The best way to validate changes after regenerating an OpenAPI spec from open_api_spex is to diff the newly generated specification against the previous version. This highlights any unexpected endpoint or schema modifications before you publish the updated documentation.