Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Warning ¶
type Warning interface {
// Code returns the warning identifier.
// Compare with Warn* constants for type-safe checks.
Code() WarningCode
// Path returns the JSON pointer to the affected spec element.
// Example: "#/webhooks", "#/info/summary"
Path() string
// Message returns a human-readable description.
Message() string
// String returns a formatted representation.
String() string
}
Warning represents an informational, non-fatal issue during spec generation.
Warnings are ADVISORY ONLY and never break execution. Use errors for issues that must stop the process.
Common scenarios that produce warnings:
- Targeting OpenAPI 3.0 when using 3.1-only features (downlevel)
- Using deprecated API features
func NewWarning ¶
func NewWarning(code WarningCode, path, message string) Warning
NewWarning creates a new Warning instance. This is the primary way to create warnings from internal packages.
type WarningCode ¶
type WarningCode string
WarningCode identifies a specific warning type. Use the Warn* constants for type-safe comparisons.
const ( // WarnDegradationWebhooks indicates webhooks were dropped (3.0 doesn't support them). WarnDegradationWebhooks WarningCode = "DEGRADATION_WEBHOOKS" // WarnDegradationInfoSummary indicates info.summary was dropped (3.0 doesn't support it). WarnDegradationInfoSummary WarningCode = "DEGRADATION_INFO_SUMMARY" // WarnDegradationLicenseIdentifier indicates license.identifier was dropped. WarnDegradationLicenseIdentifier WarningCode = "DEGRADATION_LICENSE_IDENTIFIER" // WarnDegradationMutualTLS indicates mutualTLS security scheme was dropped. WarnDegradationMutualTLS WarningCode = "DEGRADATION_MUTUAL_TLS" // WarnDegradationConstToEnum indicates JSON Schema const was converted to enum. WarnDegradationConstToEnum WarningCode = "DEGRADATION_CONST_TO_ENUM" // WarnDegradationConstToEnumConflict indicates const conflicted with existing enum. WarnDegradationConstToEnumConflict WarningCode = "DEGRADATION_CONST_TO_ENUM_CONFLICT" // WarnDegradationPathItems indicates $ref in pathItems was expanded. WarnDegradationPathItems WarningCode = "DEGRADATION_PATH_ITEMS" // WarnDegradationPatternProperties indicates patternProperties was dropped. WarnDegradationPatternProperties WarningCode = "DEGRADATION_PATTERN_PROPERTIES" // WarnDegradationUnevaluatedProperties indicates unevaluatedProperties was dropped. WarnDegradationUnevaluatedProperties WarningCode = "DEGRADATION_UNEVALUATED_PROPERTIES" // WarnDegradationContentEncoding indicates contentEncoding was dropped. WarnDegradationContentEncoding WarningCode = "DEGRADATION_CONTENT_ENCODING" // WarnDegradationContentMediaType indicates contentMediaType was dropped. WarnDegradationContentMediaType WarningCode = "DEGRADATION_CONTENT_MEDIA_TYPE" // WarnDegradationMultipleExamples indicates multiple examples were collapsed to one. WarnDegradationMultipleExamples WarningCode = "DEGRADATION_MULTIPLE_EXAMPLES" )
Schema degradation Warnings (3.1 → 3.0 schema feature losses).
const ( // WarnInvalidExampleMutualExclusivity indicates both value and externalValue were set. WarnInvalidExampleMutualExclusivity WarningCode = "INVALID_EXAMPLE_MUTUAL_EXCLUSIVITY" )
Spec violation warnings (invalid OpenAPI constructs).
func (WarningCode) String ¶
func (c WarningCode) String() string
String returns the code as a string.
type Warnings ¶
type Warnings []Warning
Warnings is a collection of Warning with helper methods. Warnings are informational and never break execution.
func (Warnings) Has ¶
func (ws Warnings) Has(code WarningCode) bool
Has returns true if any warning matches the given code.