codegen

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: GPL-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package codegen defines the intermediate representation used by generate parsers before template rendering.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthScheme

type AuthScheme struct {
	Key      string
	Type     string
	Name     string
	Location string
}

AuthScheme describes one supported authentication scheme.

type BodySchema

type BodySchema struct {
	Name     string
	Type     string
	Format   string
	Required bool
	Fields   []BodySchema
	Items    *BodySchema
}

BodySchema captures a recursive request body schema tree.

type Group

type Group struct {
	Name     string
	Requests []Request
}

Group collects related requests, usually by tag or a stable path segment.

type Header struct {
	Name     string
	Value    string
	Required bool
}

Header describes one request header requirement.

type Param

type Param struct {
	Name     string
	In       string
	Type     string
	Format   string
	Required bool
}

Param describes one non-header request parameter.

type Request

type Request struct {
	Method    string
	Path      string
	Name      string
	Summary   string
	Headers   []Header
	Params    []Param
	Body      *BodySchema
	Responses []Response
}

Request describes one generated API request shape.

type Response

type Response struct {
	StatusCode  string
	Description string
}

Response captures one response status and description from the source spec.

type Spec

type Spec struct {
	Title       string
	Version     string
	BasePath    string
	Groups      []Group
	AuthSchemes []AuthScheme
}

Spec is the top-level intermediate representation of an API specification.

Directories

Path Synopsis
Package parser turns API specifications into the internal code generation intermediate representation.
Package parser turns API specifications into the internal code generation intermediate representation.

Jump to

Keyboard shortcuts

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