Documentation
¶
Overview ¶
Package openapiimport analyzes OpenAPI documents into a deterministic, transport-neutral model suitable for later Loom design generation.
Index ¶
- Variables
- func Analyze(source []byte) (*Document, Diagnostics, error)
- func AnalyzePartial(source Source, selection Selection, allowLossy bool) (analysis *PartialAnalysis, report SelectionReport, err error)
- func AnalyzeSelected(source Source, selection Selection) (document *Document, diagnostics Diagnostics, report SelectionReport, err error)
- func RedactSourceError(err error) error
- func Render(document *Document, options Options) ([]byte, error)
- type AdditionalProperties
- type Components
- type Diagnostic
- type Diagnostics
- type Discriminator
- type DiscriminatorBranch
- type DiscriminatorEntry
- type DiscriminatorEnvelope
- type Document
- type DocumentMapping
- type Example
- type Header
- type NamedHeader
- type NamedParameter
- type NamedProperty
- type NamedRequestBody
- type NamedResponse
- type NamedSchema
- type OAuthFlow
- type Operation
- type Options
- type Parameter
- type PartialAnalysis
- type ProvenanceEntry
- type ProvenanceReference
- type RequestBody
- type Response
- type Schema
- type SchemaDefault
- type SecurityRequirement
- type SecurityRequirementScheme
- type SecurityRequirements
- type SecurityScheme
- type SecurityScope
- type Selection
- type SelectionReport
- type Server
- type SkippedOperation
- type Source
- type SourceLocation
- type StatusResponse
- type Tag
- type TagSummary
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedVersion = errors.New("unsupported OpenAPI version")
ErrUnsupportedVersion indicates that the input is not an OpenAPI 3.0, 3.1, or 3.2 document.
Functions ¶
func Analyze ¶
func Analyze(source []byte) (*Document, Diagnostics, error)
Analyze parses source without writing to the filesystem and returns a normalized model plus every unsupported-feature diagnostic it can discover. Syntax, model-building, and version failures are returned as errors.
func AnalyzePartial ¶
func AnalyzePartial(source Source, selection Selection, allowLossy bool) (analysis *PartialAnalysis, report SelectionReport, err error)
AnalyzePartial returns the largest operation subset that can be rendered. Lossy diagnostics are warnings only when allowLossy is true.
func AnalyzeSelected ¶
func AnalyzeSelected(source Source, selection Selection) (document *Document, diagnostics Diagnostics, report SelectionReport, err error)
AnalyzeSelected parses source and retains operations that match selection. It returns tag counts and paths that do not match the requested tags.
func RedactSourceError ¶ added in v1.10.0
RedactSourceError removes token-bounded URI userinfo from public error prose. Known URI producers must project whole values before formatting, including rejected malformed values. It preserves errors.Is classification without exposing the original secret-bearing error through Unwrap. Internal resolution and diagnostic selection must finish before this projection.
Types ¶
type AdditionalProperties ¶
type AdditionalProperties struct {
// Allowed retains an authored boolean value.
Allowed *bool
// Schema describes map values when additionalProperties is a schema.
Schema *Schema
}
AdditionalProperties describes the boolean-or-schema JSON Schema keyword.
type Components ¶
type Components struct {
// SecuritySchemes contains supported reusable security schemes.
SecuritySchemes []SecurityScheme
// Schemas contains reusable schema definitions sorted by source name.
Schemas []NamedSchema
// Parameters contains reusable parameter definitions.
Parameters []NamedParameter
// RequestBodies contains reusable request body definitions.
RequestBodies []NamedRequestBody
// Responses contains reusable response definitions.
Responses []NamedResponse
// Headers contains reusable header definitions.
Headers []NamedHeader
}
Components contains reusable OpenAPI definitions retained by the importer.
type Diagnostic ¶
type Diagnostic struct {
// Code identifies the importer limit class, for example "media-type".
Code string
// Path is the offending JSON Pointer, with rejected URI userinfo redacted.
Path string
// Origin identifies a transplanted or inlined occurrence in its original document.
Origin *SourceLocation
// Message explains why the construct cannot be imported faithfully.
Message string
}
Diagnostic describes an OpenAPI construct that the strict import subset cannot represent without losing contract information.
type Diagnostics ¶
type Diagnostics []Diagnostic
Diagnostics is a deterministic collection of unsupported-feature reports.
func (Diagnostics) Classify ¶
func (d Diagnostics) Classify(allowLossy bool) (fatal, warnings Diagnostics)
Classify separates diagnostics that may be omitted with explicit user consent from diagnostics that always prevent a faithful import. Unknown diagnostic codes remain fatal so new importer limits cannot be silently downgraded.
func (Diagnostics) Error ¶
func (d Diagnostics) Error() string
Error formats all diagnostics as a single error-style message.
type Discriminator ¶ added in v1.10.0
type Discriminator struct {
// PropertyName is the discriminating JSON member name.
PropertyName string
// Explicit retains authored mapping keys in source order, including aliases.
Explicit []DiscriminatorEntry
// DefaultMapping is a canonical component reference or external absolute URI.
DefaultMapping string
// Extensions contains Discriminator Object extension values.
Extensions map[string]any
// Parent reports the allOf parent hint form.
Parent bool
// Tagged records an exact JSON envelope representation, when eligible.
Tagged *DiscriminatorEnvelope
// contains filtered or unexported fields
}
Discriminator is a validated, non-validating OpenAPI selection hint.
type DiscriminatorBranch ¶ added in v1.10.0
type DiscriminatorBranch struct {
// Tag is the literal required tag value.
Tag string
// Payload is the original value member, including its annotations.
Payload *Schema
// Component is the source envelope's component name, if any.
Component string
// Description is the source envelope's description.
Description string
}
DiscriminatorBranch describes one exact envelope's payload and wire identity.
type DiscriminatorEntry ¶ added in v1.10.0
type DiscriminatorEntry struct {
// Key is the authored mapping key, never a generated branch name.
Key string
// Target is the normalized schema identity; duplicate alternatives share it.
Target *Schema
}
DiscriminatorEntry binds one explicit key to a normalized alternative.
type DiscriminatorEnvelope ¶ added in v1.10.0
type DiscriminatorEnvelope struct {
// ValueName is the common payload member.
ValueName string
// Branches are the payloads and envelope annotations in alternative order.
Branches []DiscriminatorBranch
}
DiscriminatorEnvelope retains every fact needed to synthesize exact envelopes.
type Document ¶
type Document struct {
// OpenAPIVersion is the exact supported 3.x version declared by the input.
OpenAPIVersion string
// Self is the authored OpenAPI 3.2 description URI, including relative spellings.
Self *string
// Title is the API title.
Title string
// Description is the API description.
Description string
// APIVersion is the application version from the Info object.
APIVersion string
// Tags lists declared tag names in source order.
Tags []string
// TagMetadata contains declared tag details in source order.
TagMetadata []Tag
// Extensions contains document-level vendor extensions.
Extensions map[string]any
// SecurityDefined reports whether the source declares the security member.
SecurityDefined bool
// Security contains root security requirement alternatives in source order.
Security SecurityRequirements
// Servers contains root server definitions in source order.
Servers []Server
// Components contains normalized reusable definitions.
Components Components
// Operations contains HTTP operations in deterministic path-and-method order.
Operations []Operation
// contains filtered or unexported fields
}
Document is the normalized subset of an OpenAPI document understood by the importer.
func (*Document) Provenance ¶ added in v1.10.0
func (d *Document) Provenance() []ProvenanceEntry
Provenance returns deterministic source evidence for the original analysis. Selection and partial import preserve this evidence; it is never emitted as DSL metadata.
type DocumentMapping ¶ added in v1.10.0
type DocumentMapping struct {
// URI is an absolute document URI, or an absolute prefix ending in a slash.
URI string
// Path names the local file for an exact URI or directory for a prefix.
Path string
}
DocumentMapping supplies one exact URI or a URI prefix ending in a slash.
func ParseDocumentMapping ¶ added in v1.10.0
func ParseDocumentMapping(value string) (DocumentMapping, error)
ParseDocumentMapping parses URI=PATH using the resolver's mapping policy. It normalizes URI identity without opening the supplied file or directory. Errors report a safe validation reason without echoing the composite input.
type Example ¶
type Example struct {
// Scope identifies schema or media ownership; empty retains shared DSL behavior.
Scope string
// Name is the authored media example key or a deterministic schema example name.
Name string
// Summary is the authored media example summary.
Summary string
// Description is the authored example description.
Description string
// ComponentName is the reusable OpenAPI example component name.
ComponentName string
// DataValue reports that Value belongs in the OpenAPI 3.2 dataValue field.
DataValue bool
// SerializedValue is the authored OpenAPI 3.2 serialized representation.
SerializedValue string
// Value is the decoded example value.
Value any
// contains filtered or unexported fields
}
Example is an example value retained from a schema or media type.
type Header ¶
type Header struct {
// ReferenceDescription retains a present description override on Ref.
ReferenceDescription *string
// ReferenceSummary retains a present summary override on Ref.
ReferenceSummary *string
// Ref is the authored local component reference, when retained as a reference.
Ref string
// Description is the response header description.
Description string
// Required reports whether the response header is required.
Required bool
// Deprecated reports whether the response header is deprecated.
Deprecated bool
// AllowReserved permits reserved URI characters in the encoded value.
AllowReserved bool
// Serialization retains the response header wire contract.
Serialization httpencoding.Serialization
// Schema describes the response header value.
Schema *Schema
// contains filtered or unexported fields
}
Header describes a response header. Ref is set instead of the remaining fields for a component reference.
type NamedHeader ¶
type NamedHeader struct {
// Name is the authored header name or component key.
Name string
// Header is the normalized header definition.
Header Header
}
NamedHeader is a reusable response header definition.
type NamedParameter ¶
type NamedParameter struct {
// Name is the authored OpenAPI component key.
Name string
// Parameter is the normalized component parameter.
Parameter Parameter
}
NamedParameter is a reusable parameter definition.
type NamedProperty ¶
type NamedProperty struct {
// Name is the authored JSON property name.
Name string
// Schema describes the property value.
Schema *Schema
}
NamedProperty is an object property in deterministic source-name order.
type NamedRequestBody ¶
type NamedRequestBody struct {
// Name is the authored OpenAPI component key.
Name string
// RequestBody is the normalized component request body.
RequestBody RequestBody
}
NamedRequestBody is a reusable request body definition.
type NamedResponse ¶
type NamedResponse struct {
// Name is the authored OpenAPI component key.
Name string
// Response is the normalized component response.
Response Response
}
NamedResponse is a reusable response definition.
type NamedSchema ¶
type NamedSchema struct {
// Name is the normalized declaration key. Authored components retain their
// OpenAPI key; construction-only declarations use an allocated internal key.
Name string
// GoName is the deterministic collision-safe Go identifier.
GoName string
// Schema is the normalized component schema.
Schema *Schema
// contains filtered or unexported fields
}
NamedSchema is a reusable schema and its deterministic Go identifier.
type OAuthFlow ¶
type OAuthFlow struct {
// Kind is authorizationCode, implicit, password, or clientCredentials.
Kind string
// AuthorizationURL is the flow authorization endpoint.
AuthorizationURL string
// TokenURL is the flow token endpoint.
TokenURL string
// RefreshURL is the optional flow refresh endpoint.
RefreshURL string
// Scopes contains this flow's exact scope names and descriptions.
Scopes []SecurityScope
}
OAuthFlow is one OAuth2 authorization flow.
type Operation ¶
type Operation struct {
// Method is the uppercase HTTP method.
Method string
// Path is the authored OpenAPI path template.
Path string
// OperationID is the authored OpenAPI operationId, if present.
OperationID string
// GoName is the deterministic collision-safe method identifier.
GoName string
// Summary is the authored operation summary.
Summary string
// Description is the authored operation description.
Description string
// Tags contains the operation tag names in source order.
Tags []string
// Deprecated reports whether the operation is deprecated.
Deprecated bool
// Extensions contains operation-level vendor extensions.
Extensions map[string]any
// SecurityDefined reports whether the operation overrides root security.
SecurityDefined bool
// Security contains operation security requirement alternatives.
Security SecurityRequirements
// Parameters contains inherited path-item and operation parameters.
Parameters []Parameter
// RequestBody is the operation request body, if any.
RequestBody *RequestBody
// Responses contains responses sorted by status code.
Responses []StatusResponse
// contains filtered or unexported fields
}
Operation is a normalized HTTP operation.
type Options ¶
type Options struct {
// PackageName is the Go package name used by the rendered design. It
// defaults to design.
PackageName string
}
Options configures deterministic Loom design rendering.
type Parameter ¶
type Parameter struct {
// Ref is the authored local component reference, when retained as a reference.
Ref string
// ReferenceDescription overrides the referenced parameter's description.
// A nonnil empty string explicitly removes the component description.
ReferenceDescription *string
// Name is the wire parameter name.
Name string
// In is path, query, header, or cookie.
In string
// Description is the parameter description.
Description string
// Required reports whether the parameter is required.
Required bool
// Deprecated reports whether the parameter is deprecated.
Deprecated bool
// AllowEmptyValue reports whether an empty parameter value is permitted.
AllowEmptyValue bool
// Style is the authored serialization style when Loom supports it.
Style string
// AllowReserved permits reserved URI characters in the encoded value.
AllowReserved bool
// Extensions contains parameter-level vendor extensions.
Extensions map[string]any
// Serialization retains the parameter wire contract for admission and rendering.
Serialization httpencoding.Serialization
// Schema describes the parameter value.
Schema *Schema
}
Parameter describes a path, query, header, or cookie parameter. Ref is set instead of the value fields for a component reference.
type PartialAnalysis ¶
type PartialAnalysis struct {
// Document contains all operations that pass strict analysis.
Document *Document
// Blocked contains the grouped refusal source before operations are skipped.
Blocked Diagnostics
// Warnings contains allowed lossy diagnostics for retained operations.
Warnings Diagnostics
// Omitted contains document-level constructs skipped by partial import.
Omitted Diagnostics
// OperationOmissions contains metadata omitted from retained operations.
OperationOmissions []SkippedOperation
// Skipped contains operations that cannot be rendered and their diagnostics.
Skipped []SkippedOperation
// TotalOperations is the number of operations before partial analysis.
TotalOperations int
// TotalSchemas is the number of reachable schemas before partial analysis.
TotalSchemas int
}
PartialAnalysis contains the renderable subset of an OpenAPI document.
type ProvenanceEntry ¶ added in v1.10.0
type ProvenanceEntry struct {
// Path is the node's JSON Pointer in the bundled description.
Path string
// Origin identifies the node before bundling.
Origin SourceLocation
// References lists every bundled occurrence referencing this node.
References []ProvenanceReference
}
ProvenanceEntry describes a transplanted, inlined, or rewritten contract node.
type ProvenanceReference ¶ added in v1.10.0
type ProvenanceReference struct {
// Path is the occurrence's JSON Pointer in the bundled description.
Path string
// Origin identifies the authored occurrence before bundling.
Origin SourceLocation
}
ProvenanceReference identifies one bundled reference occurrence and its source.
type RequestBody ¶
type RequestBody struct {
// ReferenceDescription retains a present description override on Ref.
ReferenceDescription *string
// ReferenceSummary retains a present summary override on Ref.
ReferenceSummary *string
// Ref is the authored local component reference, when retained as a reference.
Ref string
// Description is the request body description.
Description string
// Required reports whether the request body is required.
Required bool
// ContentTypes are the authored request media types in source order.
ContentTypes []string
// Schema describes the request body.
Schema *Schema
// Examples contains examples declared on the request media type.
Examples []Example
// Extensions contains request-body-level vendor extensions.
Extensions map[string]any
// contains filtered or unexported fields
}
RequestBody describes a request body. Ref is set instead of the remaining fields for a component reference.
type Response ¶
type Response struct {
// ReferenceDescription retains a present description override on Ref.
ReferenceDescription *string
// ReferenceSummary retains a present summary override on Ref.
ReferenceSummary *string
// Ref is the authored local component reference, when retained as a reference.
Ref string
// Description is the response description.
Description string
// Summary is the OpenAPI 3.2 response summary.
Summary string
// ContentType is the single response media type, if the response has a body.
ContentType string
// Schema describes the response body.
Schema *Schema
// Examples contains examples declared on the response media type.
Examples []Example
// Headers contains response headers sorted by wire name.
Headers []NamedHeader
// Extensions contains response-level vendor extensions.
Extensions map[string]any
// contains filtered or unexported fields
}
Response describes an HTTP response. Ref is set instead of the remaining fields for a component reference.
type Schema ¶
type Schema struct {
// Discriminator retains a validated hint without changing schema validation.
Discriminator *Discriminator
// Ref is the authored local schema component reference.
Ref string
// Boolean retains an authored boolean schema. False has no DSL representation;
// true is equivalent to an unconstrained schema in OpenAPI 3.1 and 3.2.
Boolean *bool
// Unconstrained reports that the schema accepts every JSON value.
Unconstrained bool
// Type is the single JSON Schema type.
Type string
// TypeUnion retains an authored multi-member type array. The supported
// two-member null union requires the OpenAPI 3.1 or 3.2 schema dialect.
TypeUnion []string
// Nullable reports that the schema also accepts the JSON null value.
Nullable bool
// LegacyNullable retains the OpenAPI 3.0 nullable keyword, including false.
// Other dialects reject this keyword instead of applying OpenAPI 3.0 semantics.
LegacyNullable *bool
// MediaTypes maps OneOf branches to distinct HTTP content representations.
// When present, OneOf is a service union, not an authored JSON oneOf.
MediaTypes []string
// MediaEncoding retains per-property HTTP encoding slots at this occurrence.
// Outer occurrences override declaration slots through aliases and unions.
// Captured source defaults remain separate until the occurrence codec resolves.
MediaEncoding map[string]httpencoding.Serialization
// UnionClosed rejects object members not evaluated by the selected union branch.
UnionClosed bool
// OneOf contains the branches of a supported union.
OneOf []*Schema
// Format is the authored schema format.
Format string
// Title is the schema title.
Title string
// Description is the schema description.
Description string
// Bases retains conjunctive contributors independently of local assertions.
// Object contributors use Extend; one inline non-null primitive contributor
// uses its recorded native construction declaration.
Bases []*Schema
// Properties contains object properties sorted by wire name.
Properties []NamedProperty
// Required contains sorted required property names.
Required []string
// Items describes array elements.
Items *Schema
// AdditionalProperties describes map values or object openness.
AdditionalProperties *AdditionalProperties
// Enum contains admitted non-null scalar values. Nullable owns null membership.
Enum []any
// Pattern is the string validation pattern normalized to Go regexp syntax.
Pattern string
// Minimum is the inclusive numeric lower bound.
Minimum *exactnum.Number
// Maximum is the inclusive numeric upper bound.
Maximum *exactnum.Number
// ExclusiveMinimum is the exclusive numeric lower bound.
ExclusiveMinimum *exactnum.Number
// ExclusiveMaximum is the exclusive numeric upper bound.
ExclusiveMaximum *exactnum.Number
// MinLength is the minimum string or collection length.
MinLength *int64
// MaxLength is the maximum string or collection length.
MaxLength *int64
// MinItems is the minimum array length.
MinItems *int64
// MaxItems is the maximum array length.
MaxItems *int64
// Deprecated reports whether the schema declares the JSON Schema
// deprecated keyword.
Deprecated bool
// ReadOnly reports whether the schema declares the JSON Schema readOnly
// keyword.
ReadOnly bool
// WriteOnly reports whether the schema declares the JSON Schema writeOnly
// keyword.
WriteOnly bool
// Default holds the decoded JSON Schema default value, or nil when the
// schema declares no default.
Default *SchemaDefault
// Examples contains decoded examples declared by example or examples.
Examples []Example
// Extensions contains schema-level vendor extensions.
Extensions map[string]any
// contains filtered or unexported fields
}
Schema is the normalized JSON Schema subset expressible by the first import phase. Ref may be accompanied by supported assertions and annotations authored beside $ref or a single-reference allOf wrapper.
type SchemaDefault ¶
type SchemaDefault struct {
// Value is the decoded default value.
Value any
}
SchemaDefault holds a decoded JSON Schema default value together with its presence, distinguishing an authored default from no default at all.
type SecurityRequirement ¶
type SecurityRequirement struct {
// Schemes lists required schemes in source order. An empty list permits
// anonymous access as one alternative.
Schemes []SecurityRequirementScheme
}
SecurityRequirement lists schemes that must all succeed for one alternative.
type SecurityRequirementScheme ¶
type SecurityRequirementScheme struct {
// Name is the referenced security scheme component key.
Name string
// Scopes contains authored OAuth scopes or, for non-OAuth schemes in
// OpenAPI 3.1 and 3.2, application roles. Non-OAuth requirements in
// OpenAPI 3.0 must leave this list empty.
Scopes []string
}
SecurityRequirementScheme references one component security scheme.
type SecurityRequirements ¶
type SecurityRequirements []SecurityRequirement
SecurityRequirements lists alternative OpenAPI security requirement objects.
type SecurityScheme ¶
type SecurityScheme struct {
// Name is the authored component key.
Name string
// GoName is the deterministic collision-safe variable identifier.
GoName string
// URI is the scheme-wide OpenAPI 3.2 requirement URI, when externally addressed.
URI string
// Type is the OpenAPI security scheme type.
Type string
// Scheme is the HTTP authentication scheme for type http.
Scheme string
// Description describes the credential contract.
Description string
// In identifies the credential location: header, query, or cookie.
In string
// ParameterName is the authored wire name of the credential.
ParameterName string
// Deprecated reports whether use of the scheme is discouraged.
Deprecated bool
// OAuth2MetadataURL locates OAuth authorization server metadata.
OAuth2MetadataURL string
// OAuthFlows contains supported OAuth2 flows in specification order.
OAuthFlows []OAuthFlow
// Extensions contains scheme-level vendor extensions.
Extensions map[string]any
// contains filtered or unexported fields
}
SecurityScheme is a supported reusable OpenAPI security scheme.
type SecurityScope ¶
type SecurityScope struct {
// Name is the authored scope value.
Name string
// Description explains the permission granted by the scope.
Description string
}
SecurityScope is one OAuth2 scope definition.
type Selection ¶
type Selection struct {
// Tags selects operations with at least one exact tag match.
Tags []string
// PathPrefixes selects operations whose path starts with a prefix.
PathPrefixes []string
// Paths selects operations whose path matches a path.Match pattern.
Paths []string
}
Selection identifies the union of OpenAPI operations to import.
type SelectionReport ¶
type SelectionReport struct {
// Tags contains deterministic operation and path counts by tag.
Tags []TagSummary
// UnclaimedPaths lists paths that do not use a requested tag.
UnclaimedPaths []string
// UnresolvedPaths lists Path Items whose operation and tag membership is unknown.
UnresolvedPaths []string
}
SelectionReport describes the available tags and paths excluded by tag filters.
type Server ¶ added in v1.10.0
type Server struct {
// URL is the absolute HTTP or HTTPS endpoint URI.
URL string
// Name is the authored OpenAPI 3.2 display name, or nil when absent.
Name *string
// Description is the authored description, or nil when absent.
Description *string
// contains filtered or unexported fields
}
Server retains one root Server Object in source order. Names and descriptions retain authored presence; URL retains its exact source spelling.
type SkippedOperation ¶
type SkippedOperation struct {
// Method is the uppercase HTTP method.
Method string
// Path is the authored OpenAPI path.
Path string
// Diagnostics explains why the operation cannot be rendered.
Diagnostics Diagnostics
}
SkippedOperation describes one operation omitted from a partial import.
type Source ¶ added in v1.10.0
type Source struct {
// Bytes contains the complete entry OpenAPI document.
Bytes []byte
// RetrievalPath is the entry file's absolute path, when known.
RetrievalPath string
// ReferenceRoot confines file references; empty uses the entry's real directory.
ReferenceRoot string
// Documents maps supplied retrieval URIs to local files or directories.
Documents []DocumentMapping
}
Source supplies the entry bytes and the explicit local document load policy. A byte-only source has no implicit retrieval URI or filesystem access.
type SourceLocation ¶ added in v1.10.0
type SourceLocation struct {
// Document is a portable source key, without an implicit checkout path.
Document string
// Pointer is the source document's JSON Pointer, with a leading hash.
Pointer string
// Authored retains the occurrence's original reference spelling.
Authored string
}
SourceLocation identifies an authored occurrence independently of bundle names. Public diagnostics and provenance redact rejected URI userinfo from its fields.
type StatusResponse ¶
type StatusResponse struct {
// Status is an exact HTTP code, uppercase 1XX–5XX, or "default".
Status string
// Response is the normalized response definition.
Response Response
}
StatusResponse associates an HTTP response with its authored status selector key.
type Tag ¶
type Tag struct {
// Name is the authored tag name.
Name string
// Summary is the short display label.
Summary string
// Description describes the tagged operations.
Description string
// Parent names the containing OpenAPI 3.2 tag.
Parent string
// Kind classifies the tag in OpenAPI 3.2.
Kind string
// ExternalDocsURL locates additional documentation.
ExternalDocsURL string
// ExternalDocsDescription describes the additional documentation.
ExternalDocsDescription string
// Extensions contains tag-level vendor extensions.
Extensions map[string]any
}
Tag contains OpenAPI metadata for one declared tag.
type TagSummary ¶
type TagSummary struct {
// Name is the exact OpenAPI tag name.
Name string
// Operations is the number of operations assigned to the tag.
Operations int
// Paths is the number of distinct paths assigned to the tag.
Paths int
}
TagSummary reports the number of operations and paths assigned to a tag.
Source Files
¶
- analyze.go
- analyze_examples.go
- analyze_extensions.go
- analyze_operation_identity.go
- analyze_parameter.go
- analyze_pattern.go
- analyze_reference.go
- analyze_reference_object.go
- analyze_reference_policy.go
- analyze_reference_siblings.go
- analyze_request_content.go
- analyze_schema_annotations.go
- analyze_schema_composition.go
- analyze_schema_grammar.go
- analyze_schema_promotion.go
- analyze_schema_scalar.go
- analyze_source.go
- analyze_sse.go
- analyze_sse_async.go
- analyze_tags.go
- analyze_value_domain.go
- diagnostic_display.go
- diagnostics.go
- discriminator.go
- discriminator_envelope.go
- discriminator_occurrence.go
- discriminator_projection.go
- example_membership.go
- media_contract.go
- media_encoding_context.go
- media_source_type.go
- model.go
- names.go
- names_inventory.go
- numeric_source.go
- numeric_source_identity.go
- object_field_names.go
- object_representation.go
- oneof_admission.go
- oneof_normalize.go
- oneof_promotion.go
- oneof_siblings.go
- parameter_admission.go
- partial.go
- plan.go
- plan_references.go
- plan_responses.go
- plan_reusable.go
- plan_sse.go
- plan_sse_async.go
- provenance.go
- render.go
- render_discriminator.go
- render_index.go
- render_media.go
- render_nullable.go
- render_oneof.go
- render_parameter_codec.go
- render_parameters.go
- render_request_body.go
- render_required.go
- render_response.go
- render_reusable.go
- render_schema.go
- render_sse.go
- render_status.go
- render_tags.go
- resolve.go
- resolve_bundle.go
- resolve_depth.go
- resolve_discriminator.go
- resolve_grammar.go
- resolve_load.go
- resolve_open_unix.go
- resolve_path_item.go
- resolve_provenance.go
- resolve_security.go
- resolve_sse.go
- resolve_tree.go
- resolve_uri.go
- scalar_literal.go
- schema_classification.go
- schema_encoding.go
- schema_presence.go
- security.go
- security_credentials.go
- selection.go
- selection_references.go
- servers.go
- source.go
- sse_reference_contract.go
- string_representation.go
- url_serialization.go
- url_shape.go