Back to directory

PhoenixSpec

Generates an OpenAPI 3.1 specification for a Phoenix application automatically, by reading its Ecto schemas, JSON views and router instead of a separate spec file.

PhoenixSpec

PhoenixSpec produces an OpenAPI 3.1 specification from parts of a Phoenix API that already exist: it reads field types from Ecto schemas, the fields a JSON view module exposes and how they nest, and the routes, HTTP verbs and path parameters from the router.

Running its Mix task introspects the router, finds the associated JSON views, reads the Ecto schemas they reference, and writes an openapi.json or openapi.yaml file, plus an optional api.d.ts. It infers types such as strings, integers, datetimes and enums, resolves associations such as belongs_to, follows the standard phx.gen.json controller and context-module patterns to build request bodies, and generates a oneOf schema when a JSON view has multiple clauses for different structs.

It is an Elixir library added as a development-only Mix dependency.

More in Libraries

See all 292
  • OpenDecision

    deepanwadhwa.github.io

    An open-source Python package that answers typed questions about application state or documents using a local natural-language-inference model, returning structured choice, score, yes/no or evidence-relation values instead of free text.

  • TradeCanvas

    bonguynvan.github.io

    A zero-dependency canvas charting engine for building TradingView-style trading charts in JavaScript, with 66 technical indicators, 24 drawing tools, 17 chart types, and real-time streaming.

  • 3d retro graphics

    3d-retro.com

    A free, CC0-licensed library of copy-paste retro 3D and demoscene graphics effects, such as plasma, raytracing, and voxel terrain, runnable as WebGL 1 or plain 2D canvas.