diag

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package diag is how every stage reports a problem in a spec: a severity, a code, a message, and where in the spec it is.

Index

Constants

View Source
const (
	CodeCircularRef            = "circular-ref"
	CodeInfiniteCircularRef    = "infinite-circular-ref"
	CodeBuildIssue             = "build-issue"
	CodeSchemaBuild            = "schema-build"
	CodeUnknownType            = "unknown-type"
	CodeSchemaInvalid          = "schema-invalid"
	CodeKeywordInvalid         = "keyword-invalid"
	CodeKeywordVersion         = "keyword-version"
	CodeKeywordUnsupported     = "keyword-unsupported"
	CodeInvalidStatus          = "invalid-status"
	CodeMediaTypeEmpty         = "media-type-empty"
	CodeUnresolvedMapping      = "unresolved-mapping"
	CodeOptionalPathParam      = "optional-path-param"
	CodeParamIn                = "param-in"
	CodePathParamUnused        = "path-param-unused"
	CodeNameEmpty              = "name-empty"
	CodeDuplicateParam         = "duplicate-param"
	CodeOperationIDDuplicate   = "operation-id-duplicate"
	CodeOverlayTarget          = "overlay-target"
	CodeBundleRename           = "bundle-rename"
	CodeUnbundledRef           = "unbundled-ref"
	CodeFilterUnknown          = "filter-unknown"
	CodeFilterRequired         = "filter-required"
	CodeFilterEmpty            = "filter-empty"
	CodePruneUnsupported       = "prune-unsupported"
	CodePruneSkipped           = "prune-skipped"
	CodeNameClash              = "name-clash"
	CodeUnionDuplicate         = "union-duplicate"
	CodeUnionSelf              = "union-self"
	CodeUnionAmbiguous         = "union-ambiguous"
	CodePatternUnsupported     = "pattern-unsupported"
	CodeLimitUnsupported       = "limit-unsupported"
	CodeErrorMapping           = "error-mapping"
	CodeExtensionUnknown       = "extension-unknown"
	CodeExtensionValue         = "extension-value"
	CodeEnumIgnored            = "enum-ignored"
	CodeEnumNameUnexported     = "enum-name-unexported"
	CodeEnumValue              = "enum-value"
	CodeDefaultIgnored         = "default-ignored"
	CodeGetterSkipped          = "getter-skipped"
	CodeAllOfConflict          = "allof-conflict"
	CodeAllOfCycle             = "allof-cycle"
	CodeAliasCycle             = "alias-cycle"
	CodeRouteDropped           = "route-dropped"
	CodeStreamOnly             = "stream-only"
	CodePathParamMissing       = "path-param-missing"
	CodeClientBodyUnread       = "client-body-unread"
	CodeClientBodyUnwritable   = "client-body-unwritable"
	CodeServerBodyUnread       = "server-body-unread"
	CodeServerBodyUnwritable   = "server-body-unwritable"
	CodeStreamUnread           = "stream-unread"
	CodeQueryStringUnsupported = "querystring-unsupported"
	CodeParamUnsupported       = "param-unsupported"
	CodeDeepObjectConvention   = "deepobject-convention"
	CodeEncodingIgnored        = "encoding-ignored"
	CodeEncodingUnsupported    = "encoding-unsupported"
	CodeMCPToolName            = "mcp-tool-name"
	CodeImportUnused           = "import-unused"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

func (*Collector) Append

func (c *Collector) Append(ds ...Diagnostic)

func (*Collector) List

func (c *Collector) List() []Diagnostic

List returns the diagnostics sorted by file, line, column, code, pointer and message.

type Diagnostic

type Diagnostic struct {
	Severity Severity
	Code     string
	Pointer  string
	Origin   Origin
	Message  string
}

type Origin

type Origin struct {
	File string
	Line int
	Col  int
}

Origin is a position in a source file; Line and Col are 1-based, zero means unknown.

type Severity

type Severity int
const (
	Info Severity = iota
	Warning
	Error
)

func (Severity) String

func (s Severity) String() string

Jump to

Keyboard shortcuts

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