Help us shape the future of Go! Take the 2026 Go Developer Survey

docmeta

package module
v0.0.0-...-29e069e Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package docmeta defines the shared documentation-metadata contract used by all collectors. Each language extracts its own documentation sources (JavaDoc and Swagger annotations, Go doc comments and struct tags, JSDoc, Python docstrings and Pydantic fields) into a normalized Documentation value, which is then applied to a model.FieldModel via ApplyTo.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(value bool) *bool

Bool returns a pointer to value, for building Documentation.Required.

func OptionsFromValues

func OptionsFromValues(values []string) []model.FieldOption

OptionsFromValues converts a list of enum values into field options. It returns nil when values is empty.

Types

type Documentation

type Documentation struct {
	// Comment is the human-readable description of the field.
	Comment string
	// Demo is an example value rendered as the field's demo.
	Demo string
	// DefaultValue is the documented default of the field.
	DefaultValue string
	// Required overrides the field's required flag when non-nil.
	Required *bool
	// Options lists the allowed values of the field, if documented as an enum.
	Options []model.FieldOption
}

Documentation is the normalized form of a field's documentation metadata, independent of the source language.

func (Documentation) ApplyTo

func (d Documentation) ApplyTo(fm *model.FieldModel)

ApplyTo writes the documented metadata onto fm. Only non-empty entries override what fm already carries, so callers may pre-populate fallbacks (e.g. a language-specific default for Required) before applying. ApplyTo is a no-op when fm is nil.

Jump to

Keyboard shortcuts

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