AshOaskit.Generators.V31 (AshOasKit v0.4.0)

View Source

Generates OpenAPI 3.1.0 documents.

This is the default for new integrations. Schemas follow the OpenAPI 3.1 JSON Schema dialect, including type arrays such as "type": ["string", "null"] for nullable values.

Relationship to Other Modules

This module is a thin entry point that delegates to AshOaskit.Generators.Shared, which in turn coordinates AshOaskit.Generators.Generator, AshOaskit.Generators.InfoBuilder, and AshOaskit.Generators.PathBuilder. The only responsibility of this module is to pin the :version option to "3.1" before handing off to the shared pipeline.

Usage

spec = AshOaskit.Generators.V31.generate([MyApp.Blog], title: "Blog API")
spec["openapi"]
#=> "3.1.0"

In practice you rarely call this module directly. Use the high-level API instead:

AshOaskit.spec(domains: [MyApp.Blog], version: "3.1")

Or let the AshOaskit.Router macro handle version routing automatically.

Summary

Functions

Generate an OpenAPI 3.1 specification from the given domains.

Functions

generate(domains, opts)

@spec generate(
  [module()],
  keyword()
) :: map()

Generate an OpenAPI 3.1 specification from the given domains.