openapi

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package openapi generates an OpenAPI document from a resolved model.

docs/design/schema-backends.md has the mapping and the reasons for it. The document holds schemas and no paths: every declaration is a schema under components (definitions in 2.0), built by backend/internal/jsonschema in the dialect the version speaks. An enum whose variants carry fields is a oneOf of one schema per variant with a discriminator naming them, which OpenAPI 2.0 has no way to say.

Index

Constants

View Source
const Name = "openapi"

Name is what this backend is called, in a target block and as tdl-gen-openapi on PATH.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct{}

Backend implements plugin.Backend.

func (Backend) Describe

func (Backend) Describe() plugin.Description

func (Backend) Generate

func (Backend) Generate(_ context.Context, req *plugin.Request) (*plugin.Response, error)

Generate returns one document holding every declaration the model owns.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL