openapi

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 2 Imported by: 0

README

OpenAPI

CI Status codecov Go Report Card CodeQL Go Reference License Go Version Release

OpenAPI 3.1 as native Go types. Build, read, and write API specifications with full type safety.

OpenAPI in Go

The OpenAPI specification becomes Go structs—each type mirrors the spec exactly:

spec := &openapi.OpenAPI{
    OpenAPI: "3.1.0",
    Info: openapi.Info{
        Title:   "Users API",
        Version: "1.0.0",
    },
    Paths: map[string]openapi.PathItem{
        "/users/{id}": {
            Get: &openapi.Operation{
                OperationID: "getUser",
                Parameters: []openapi.Parameter{{
                    Name:     "id",
                    In:       "path",
                    Required: true,
                    Schema:   &openapi.Schema{Type: openapi.NewSchemaType("string")},
                }},
                Responses: map[string]openapi.Response{
                    "200": {Description: "User found"},
                },
            },
        },
    },
}

No wrapper functions. No builder patterns. Just the specification as data.

Install

go get github.com/zoobz-io/openapi

Requires Go 1.24 or higher.

Quick Start

package main

import (
    "encoding/json"
    "fmt"
    "os"

    "github.com/zoobz-io/openapi"
    "gopkg.in/yaml.v3"
)

func main() {
    // Build a specification
    spec := &openapi.OpenAPI{
        OpenAPI: "3.1.0",
        Info: openapi.Info{
            Title:       "Pet Store",
            Version:     "1.0.0",
            Description: "A sample pet store API",
        },
        Paths: map[string]openapi.PathItem{
            "/pets": {
                Get: &openapi.Operation{
                    Summary:     "List all pets",
                    OperationID: "listPets",
                    Responses: map[string]openapi.Response{
                        "200": {
                            Description: "A list of pets",
                            Content: map[string]openapi.MediaType{
                                "application/json": {
                                    Schema: &openapi.Schema{
                                        Type:  openapi.NewSchemaType("array"),
                                        Items: &openapi.Schema{Ref: "#/components/schemas/Pet"},
                                    },
                                },
                            },
                        },
                    },
                },
            },
        },
        Components: &openapi.Components{
            Schemas: map[string]*openapi.Schema{
                "Pet": {
                    Type: openapi.NewSchemaType("object"),
                    Properties: map[string]*openapi.Schema{
                        "id":   {Type: openapi.NewSchemaType("integer")},
                        "name": {Type: openapi.NewSchemaType("string")},
                    },
                    Required: []string{"id", "name"},
                },
            },
        },
    }

    // Output as JSON
    json.NewEncoder(os.Stdout).Encode(spec)

    // Or YAML
    yaml.NewEncoder(os.Stdout).Encode(spec)

    // Read existing specs
    data, _ := os.ReadFile("api.yaml")
    var existing openapi.OpenAPI
    yaml.Unmarshal(data, &existing)
    fmt.Println(existing.Info.Title)
}

Why OpenAPI?

  • Direct mapping: Types match the OpenAPI 3.1 specification exactly—no translation layer
  • Full coverage: Every spec construct supported, from basic paths to discriminators and callbacks
  • Dual format: JSON and YAML serialization work identically via struct tags
  • Zero magic: Standard Go marshalling, no reflection tricks or code generation
  • Minimal footprint: Single dependency (yaml.v3), pure data structures

Documentation

  • Overview — Design philosophy and scope
  • Quick Start — Common usage patterns
  • Types — Type hierarchy and relationships

Contributing

Contributions welcome. See CONTRIBUTING.md for guidelines.

License

MIT

Documentation

Overview

Package openapi provides a comprehensive Go implementation of the OpenAPI 3.1 specification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback map[string]PathItem

Callback is a map of possible out-of band callbacks.

type Components

type Components struct {
	Schemas         map[string]*Schema         `json:"schemas,omitempty" yaml:"schemas,omitempty"`
	Responses       map[string]*Response       `json:"responses,omitempty" yaml:"responses,omitempty"`
	Parameters      map[string]*Parameter      `json:"parameters,omitempty" yaml:"parameters,omitempty"`
	Examples        map[string]*Example        `json:"examples,omitempty" yaml:"examples,omitempty"`
	RequestBodies   map[string]*RequestBody    `json:"requestBodies,omitempty" yaml:"requestBodies,omitempty"`
	Headers         map[string]*Header         `json:"headers,omitempty" yaml:"headers,omitempty"`
	SecuritySchemes map[string]*SecurityScheme `json:"securitySchemes,omitempty" yaml:"securitySchemes,omitempty"`
	Links           map[string]*Link           `json:"links,omitempty" yaml:"links,omitempty"`
	Callbacks       map[string]*Callback       `json:"callbacks,omitempty" yaml:"callbacks,omitempty"`
	PathItems       map[string]*PathItem       `json:"pathItems,omitempty" yaml:"pathItems,omitempty"`
}

Components holds reusable objects for the specification.

type Contact

type Contact struct {
	Name  string `json:"name,omitempty" yaml:"name,omitempty"`
	URL   string `json:"url,omitempty" yaml:"url,omitempty"`
	Email string `json:"email,omitempty" yaml:"email,omitempty"`
}

Contact information for the API.

type Discriminator

type Discriminator struct {
	Mapping      map[string]string `json:"mapping,omitempty" yaml:"mapping,omitempty"`
	PropertyName string            `json:"propertyName" yaml:"propertyName"`
}

Discriminator supports polymorphism.

type Encoding

type Encoding struct {
	Headers       map[string]*Header `json:"headers,omitempty" yaml:"headers,omitempty"`
	Explode       *bool              `json:"explode,omitempty" yaml:"explode,omitempty"`
	ContentType   string             `json:"contentType,omitempty" yaml:"contentType,omitempty"`
	Style         string             `json:"style,omitempty" yaml:"style,omitempty"`
	AllowReserved bool               `json:"allowReserved,omitempty" yaml:"allowReserved,omitempty"`
}

Encoding property for multipart media types.

type Example

type Example struct {
	Ref           string `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	Summary       string `json:"summary,omitempty" yaml:"summary,omitempty"`
	Description   string `json:"description,omitempty" yaml:"description,omitempty"`
	Value         any    `json:"value,omitempty" yaml:"value,omitempty"`
	ExternalValue string `json:"externalValue,omitempty" yaml:"externalValue,omitempty"`
}

Example object for example values.

type ExternalDocumentation

type ExternalDocumentation struct {
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	URL         string `json:"url" yaml:"url"`
}

ExternalDocumentation allows referencing an external resource.

type Header struct {
	Example         any                  `json:"example,omitempty" yaml:"example,omitempty"`
	Explode         *bool                `json:"explode,omitempty" yaml:"explode,omitempty"`
	Schema          *Schema              `json:"schema,omitempty" yaml:"schema,omitempty"`
	Examples        map[string]*Example  `json:"examples,omitempty" yaml:"examples,omitempty"`
	Content         map[string]MediaType `json:"content,omitempty" yaml:"content,omitempty"`
	Ref             string               `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	Description     string               `json:"description,omitempty" yaml:"description,omitempty"`
	Style           string               `json:"style,omitempty" yaml:"style,omitempty"`
	Required        bool                 `json:"required,omitempty" yaml:"required,omitempty"`
	Deprecated      bool                 `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`
	AllowEmptyValue bool                 `json:"allowEmptyValue,omitempty" yaml:"allowEmptyValue,omitempty"`
	AllowReserved   bool                 `json:"allowReserved,omitempty" yaml:"allowReserved,omitempty"`
}

Header follows the structure of Parameter but without name and in fields.

type Info

type Info struct {
	Title          string   `json:"title" yaml:"title"`
	Description    string   `json:"description,omitempty" yaml:"description,omitempty"`
	TermsOfService string   `json:"termsOfService,omitempty" yaml:"termsOfService,omitempty"`
	Contact        *Contact `json:"contact,omitempty" yaml:"contact,omitempty"`
	License        *License `json:"license,omitempty" yaml:"license,omitempty"`
	Version        string   `json:"version" yaml:"version"`
}

Info provides metadata about the API.

type License

type License struct {
	Name       string `json:"name" yaml:"name"`
	URL        string `json:"url,omitempty" yaml:"url,omitempty"`
	Identifier string `json:"identifier,omitempty" yaml:"identifier,omitempty"`
}

License information for the API.

type Link struct {
	RequestBody  any            `json:"requestBody,omitempty" yaml:"requestBody,omitempty"`
	Parameters   map[string]any `json:"parameters,omitempty" yaml:"parameters,omitempty"`
	Server       *Server        `json:"server,omitempty" yaml:"server,omitempty"`
	Ref          string         `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	OperationRef string         `json:"operationRef,omitempty" yaml:"operationRef,omitempty"`
	OperationID  string         `json:"operationId,omitempty" yaml:"operationId,omitempty"`
	Description  string         `json:"description,omitempty" yaml:"description,omitempty"`
}

Link represents a possible design-time link for a response.

type MediaType

type MediaType struct {
	Schema   *Schema             `json:"schema,omitempty" yaml:"schema,omitempty"`
	Example  any                 `json:"example,omitempty" yaml:"example,omitempty"`
	Examples map[string]*Example `json:"examples,omitempty" yaml:"examples,omitempty"`
	Encoding map[string]Encoding `json:"encoding,omitempty" yaml:"encoding,omitempty"`
}

MediaType provides schema and examples for the media type.

type OAuthFlow

type OAuthFlow struct {
	Scopes           map[string]string `json:"scopes" yaml:"scopes"`
	AuthorizationURL string            `json:"authorizationUrl,omitempty" yaml:"authorizationUrl,omitempty"`
	TokenURL         string            `json:"tokenUrl,omitempty" yaml:"tokenUrl,omitempty"`
	RefreshURL       string            `json:"refreshUrl,omitempty" yaml:"refreshUrl,omitempty"`
}

OAuthFlow configuration details for a supported OAuth flow.

type OAuthFlows

type OAuthFlows struct {
	Implicit          *OAuthFlow `json:"implicit,omitempty" yaml:"implicit,omitempty"`
	Password          *OAuthFlow `json:"password,omitempty" yaml:"password,omitempty"`
	ClientCredentials *OAuthFlow `json:"clientCredentials,omitempty" yaml:"clientCredentials,omitempty"`
	AuthorizationCode *OAuthFlow `json:"authorizationCode,omitempty" yaml:"authorizationCode,omitempty"`
}

OAuthFlows allows configuration of the supported OAuth flows.

type OpenAPI

type OpenAPI struct {
	Paths        map[string]PathItem    `json:"paths" yaml:"paths"`
	Webhooks     map[string]*PathItem   `json:"webhooks,omitempty" yaml:"webhooks,omitempty"`
	Components   *Components            `json:"components,omitempty" yaml:"components,omitempty"`
	ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
	Info         Info                   `json:"info" yaml:"info"`
	OpenAPI      string                 `json:"openapi" yaml:"openapi"`
	Servers      []Server               `json:"servers,omitempty" yaml:"servers,omitempty"`
	Security     []SecurityRequirement  `json:"security,omitempty" yaml:"security,omitempty"`
	Tags         []Tag                  `json:"tags,omitempty" yaml:"tags,omitempty"`
	TagGroups    []TagGroup             `json:"x-tagGroups,omitempty" yaml:"x-tagGroups,omitempty"`
}

OpenAPI represents the root document object.

func FromJSON

func FromJSON(data []byte) (*OpenAPI, error)

FromJSON unmarshals JSON bytes into an OpenAPI spec.

func FromYAML

func FromYAML(data []byte) (*OpenAPI, error)

FromYAML unmarshals YAML bytes into an OpenAPI spec.

func (*OpenAPI) ToJSON

func (o *OpenAPI) ToJSON() ([]byte, error)

ToJSON marshals the OpenAPI spec to JSON bytes.

func (*OpenAPI) ToYAML

func (o *OpenAPI) ToYAML() ([]byte, error)

ToYAML marshals the OpenAPI spec to YAML bytes.

type Operation

type Operation struct {
	ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
	RequestBody  *RequestBody           `json:"requestBody,omitempty" yaml:"requestBody,omitempty"`
	Responses    map[string]Response    `json:"responses" yaml:"responses"`
	Callbacks    map[string]Callback    `json:"callbacks,omitempty" yaml:"callbacks,omitempty"`
	Summary      string                 `json:"summary,omitempty" yaml:"summary,omitempty"`
	Description  string                 `json:"description,omitempty" yaml:"description,omitempty"`
	OperationID  string                 `json:"operationId,omitempty" yaml:"operationId,omitempty"`
	Tags         []string               `json:"tags,omitempty" yaml:"tags,omitempty"`
	Parameters   []Parameter            `json:"parameters,omitempty" yaml:"parameters,omitempty"`
	Security     []SecurityRequirement  `json:"security,omitempty" yaml:"security,omitempty"`
	Servers      []Server               `json:"servers,omitempty" yaml:"servers,omitempty"`
	Deprecated   bool                   `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`
}

Operation describes a single API operation on a path.

type Parameter

type Parameter struct {
	Example         any                  `json:"example,omitempty" yaml:"example,omitempty"`
	Schema          *Schema              `json:"schema,omitempty" yaml:"schema,omitempty"`
	Content         map[string]MediaType `json:"content,omitempty" yaml:"content,omitempty"`
	Examples        map[string]*Example  `json:"examples,omitempty" yaml:"examples,omitempty"`
	Explode         *bool                `json:"explode,omitempty" yaml:"explode,omitempty"`
	Name            string               `json:"name,omitempty" yaml:"name,omitempty"`
	In              string               `json:"in,omitempty" yaml:"in,omitempty"`
	Description     string               `json:"description,omitempty" yaml:"description,omitempty"`
	Ref             string               `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	Style           string               `json:"style,omitempty" yaml:"style,omitempty"`
	AllowEmptyValue bool                 `json:"allowEmptyValue,omitempty" yaml:"allowEmptyValue,omitempty"`
	AllowReserved   bool                 `json:"allowReserved,omitempty" yaml:"allowReserved,omitempty"`
	Deprecated      bool                 `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`
	Required        bool                 `json:"required,omitempty" yaml:"required,omitempty"`
}

Parameter describes a single operation parameter.

type PathItem

type PathItem struct {
	Ref         string      `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	Summary     string      `json:"summary,omitempty" yaml:"summary,omitempty"`
	Description string      `json:"description,omitempty" yaml:"description,omitempty"`
	Get         *Operation  `json:"get,omitempty" yaml:"get,omitempty"`
	Post        *Operation  `json:"post,omitempty" yaml:"post,omitempty"`
	Put         *Operation  `json:"put,omitempty" yaml:"put,omitempty"`
	Delete      *Operation  `json:"delete,omitempty" yaml:"delete,omitempty"`
	Patch       *Operation  `json:"patch,omitempty" yaml:"patch,omitempty"`
	Options     *Operation  `json:"options,omitempty" yaml:"options,omitempty"`
	Head        *Operation  `json:"head,omitempty" yaml:"head,omitempty"`
	Servers     []Server    `json:"servers,omitempty" yaml:"servers,omitempty"`
	Parameters  []Parameter `json:"parameters,omitempty" yaml:"parameters,omitempty"`
}

PathItem describes operations available on a single path.

type RequestBody

type RequestBody struct {
	Content     map[string]MediaType `json:"content,omitempty" yaml:"content,omitempty"`
	Ref         string               `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	Description string               `json:"description,omitempty" yaml:"description,omitempty"`
	Required    bool                 `json:"required,omitempty" yaml:"required,omitempty"`
}

RequestBody describes a request body.

type Response

type Response struct {
	Headers     map[string]*Header   `json:"headers,omitempty" yaml:"headers,omitempty"`
	Content     map[string]MediaType `json:"content,omitempty" yaml:"content,omitempty"`
	Links       map[string]*Link     `json:"links,omitempty" yaml:"links,omitempty"`
	Ref         string               `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	Description string               `json:"description,omitempty" yaml:"description,omitempty"`
}

Response describes a single response from an API operation.

type Schema

type Schema struct {
	AdditionalProperties any                    `json:"additionalProperties,omitempty" yaml:"additionalProperties,omitempty"`
	Example              any                    `json:"example,omitempty" yaml:"example,omitempty"`
	Default              any                    `json:"default,omitempty" yaml:"default,omitempty"`
	Const                any                    `json:"const,omitempty" yaml:"const,omitempty"`
	ExclusiveMaximum     *float64               `json:"exclusiveMaximum,omitempty" yaml:"exclusiveMaximum,omitempty"`
	Not                  *Schema                `json:"not,omitempty" yaml:"not,omitempty"`
	Items                *Schema                `json:"items,omitempty" yaml:"items,omitempty"`
	Deprecated           *bool                  `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`
	Discriminator        *Discriminator         `json:"discriminator,omitempty" yaml:"discriminator,omitempty"`
	WriteOnly            *bool                  `json:"writeOnly,omitempty" yaml:"writeOnly,omitempty"`
	ReadOnly             *bool                  `json:"readOnly,omitempty" yaml:"readOnly,omitempty"`
	ExternalDocs         *ExternalDocumentation `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
	MaxLength            *int                   `json:"maxLength,omitempty" yaml:"maxLength,omitempty"`
	XML                  *XML                   `json:"xml,omitempty" yaml:"xml,omitempty"`
	UniqueItems          *bool                  `json:"uniqueItems,omitempty" yaml:"uniqueItems,omitempty"`
	Minimum              *float64               `json:"minimum,omitempty" yaml:"minimum,omitempty"`
	Maximum              *float64               `json:"maximum,omitempty" yaml:"maximum,omitempty"`
	ExclusiveMinimum     *float64               `json:"exclusiveMinimum,omitempty" yaml:"exclusiveMinimum,omitempty"`
	MaxProperties        *int                   `json:"maxProperties,omitempty" yaml:"maxProperties,omitempty"`
	Properties           map[string]*Schema     `json:"properties,omitempty" yaml:"properties,omitempty"`
	MinLength            *int                   `json:"minLength,omitempty" yaml:"minLength,omitempty"`
	MultipleOf           *float64               `json:"multipleOf,omitempty" yaml:"multipleOf,omitempty"`
	MinProperties        *int                   `json:"minProperties,omitempty" yaml:"minProperties,omitempty"`
	MinItems             *int                   `json:"minItems,omitempty" yaml:"minItems,omitempty"`
	MaxItems             *int                   `json:"maxItems,omitempty" yaml:"maxItems,omitempty"`
	Format               string                 `json:"format,omitempty" yaml:"format,omitempty"`
	Pattern              string                 `json:"pattern,omitempty" yaml:"pattern,omitempty"`
	Type                 *SchemaType            `json:"type,omitempty" yaml:"type,omitempty"`
	Title                string                 `json:"title,omitempty" yaml:"title,omitempty"`
	Description          string                 `json:"description,omitempty" yaml:"description,omitempty"`
	Ref                  string                 `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	OneOf                []*Schema              `json:"oneOf,omitempty" yaml:"oneOf,omitempty"`
	Enum                 []any                  `json:"enum,omitempty" yaml:"enum,omitempty"`
	AnyOf                []*Schema              `json:"anyOf,omitempty" yaml:"anyOf,omitempty"`
	AllOf                []*Schema              `json:"allOf,omitempty" yaml:"allOf,omitempty"`
	Required             []string               `json:"required,omitempty" yaml:"required,omitempty"`
}

Schema represents a JSON Schema.

type SchemaType

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

SchemaType represents the type field in a JSON Schema, which can be either a single string (e.g., "string") or an array of strings (e.g., ["string", "null"]).

func NewSchemaType

func NewSchemaType(s string) *SchemaType

NewSchemaType creates a SchemaType pointer from a single type string.

func NewSchemaTypes

func NewSchemaTypes(s []string) *SchemaType

NewSchemaTypes creates a SchemaType pointer from multiple type strings.

func (SchemaType) Contains

func (t SchemaType) Contains(s string) bool

Contains returns true if the given type is present.

func (SchemaType) IsArray

func (t SchemaType) IsArray() bool

IsArray returns true if the type is an array of types.

func (SchemaType) IsEmpty

func (t SchemaType) IsEmpty() bool

IsEmpty returns true if no type is set.

func (SchemaType) IsNullable

func (t SchemaType) IsNullable() bool

IsNullable returns true if "null" is one of the types.

func (SchemaType) MarshalJSON

func (t SchemaType) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (SchemaType) MarshalYAML

func (t SchemaType) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaler.

func (SchemaType) String

func (t SchemaType) String() string

String returns the type as a single string. If the type is an array, returns the first element. Returns empty string if no type is set.

func (SchemaType) Strings

func (t SchemaType) Strings() []string

Strings returns the type as a slice of strings. If the type is a single string, returns a slice containing that string.

func (*SchemaType) UnmarshalJSON

func (t *SchemaType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*SchemaType) UnmarshalYAML

func (t *SchemaType) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler.

type SecurityRequirement

type SecurityRequirement map[string][]string

SecurityRequirement lists required security schemes to execute an operation.

type SecurityScheme

type SecurityScheme struct {
	Type             string      `json:"type" yaml:"type"` // "apiKey", "http", "oauth2", "openIdConnect"
	Description      string      `json:"description,omitempty" yaml:"description,omitempty"`
	Name             string      `json:"name,omitempty" yaml:"name,omitempty"`                         // for apiKey
	In               string      `json:"in,omitempty" yaml:"in,omitempty"`                             // for apiKey: "query", "header", "cookie"
	Scheme           string      `json:"scheme,omitempty" yaml:"scheme,omitempty"`                     // for http: "bearer", "basic", etc.
	BearerFormat     string      `json:"bearerFormat,omitempty" yaml:"bearerFormat,omitempty"`         // for http bearer
	Flows            *OAuthFlows `json:"flows,omitempty" yaml:"flows,omitempty"`                       // for oauth2
	OpenIDConnectURL string      `json:"openIdConnectUrl,omitempty" yaml:"openIdConnectUrl,omitempty"` // for openIdConnect
}

SecurityScheme defines a security scheme for the API.

type Server

type Server struct {
	Variables   map[string]ServerVariable `json:"variables,omitempty" yaml:"variables,omitempty"`
	URL         string                    `json:"url" yaml:"url"`
	Description string                    `json:"description,omitempty" yaml:"description,omitempty"`
}

Server represents a server.

type ServerVariable

type ServerVariable struct {
	Default     string   `json:"default" yaml:"default"`
	Description string   `json:"description,omitempty" yaml:"description,omitempty"`
	Enum        []string `json:"enum,omitempty" yaml:"enum,omitempty"`
}

ServerVariable represents a server variable for server URL template substitution.

type Tag

type Tag struct {
	ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
	Name         string                 `json:"name" yaml:"name"`
	Description  string                 `json:"description,omitempty" yaml:"description,omitempty"`
}

Tag adds metadata to a single tag.

type TagGroup

type TagGroup struct {
	Name string   `json:"name" yaml:"name"`
	Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

TagGroup groups tags for documentation tools like Redoc.

type XML

type XML struct {
	Name      string `json:"name,omitempty" yaml:"name,omitempty"`
	Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
	Prefix    string `json:"prefix,omitempty" yaml:"prefix,omitempty"`
	Attribute bool   `json:"attribute,omitempty" yaml:"attribute,omitempty"`
	Wrapped   bool   `json:"wrapped,omitempty" yaml:"wrapped,omitempty"`
}

XML metadata for array/object schemas.

Jump to

Keyboard shortcuts

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