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 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.