MCPcopy
hub / github.com/danielgtaylor/huma / OpenAPI

Struct OpenAPI

openapi.go:1435–1498  ·  view source on GitHub ↗

OpenAPI is the root object of the OpenAPI document.

Source from the content-addressed store, hash-verified

1433
1434// OpenAPI is the root object of the OpenAPI document.
1435type OpenAPI struct {
1436 // OpenAPI is REQUIRED. This string MUST be the version number of the OpenAPI
1437 // Specification that the OpenAPI document uses. The openapi field SHOULD be
1438 // used by tooling to interpret the OpenAPI document. This is not related to
1439 // the API info.version string.
1440 OpenAPI string `yaml:"openapi"`
1441
1442 // Info is REQUIRED. Provides metadata about the API. The metadata MAY be used
1443 // by tooling as required.
1444 Info *Info `yaml:"info"`
1445
1446 // JSONSchemaDialect is the default value for the $schema keyword within Schema
1447 // Objects contained within this OAS document. This MUST be in the form of a
1448 // URI.
1449 JSONSchemaDialect string `yaml:"jsonSchemaDialect,omitempty"`
1450
1451 // Servers is an array of Server Objects, which provide connectivity
1452 // information to a target server. If the servers property is not provided, or
1453 // is an empty array, the default value would be a Server Object with a url
1454 // value of /.
1455 Servers []*Server `yaml:"servers,omitempty"`
1456
1457 // Paths are the available paths and operations for the API.
1458 Paths map[string]*PathItem `yaml:"paths,omitempty"`
1459
1460 // Webhooks that MAY be received as part of this API and that the API consumer
1461 // MAY choose to implement. Closely related to the callbacks feature, this
1462 // section describes requests initiated other than by an API call, for example
1463 // by an out of band registration. The key name is a unique string to refer to
1464 // each webhook, while the (optionally referenced) Path Item Object describes
1465 // a request that may be initiated by the API provider and the expected
1466 // responses. An example is available.
1467 Webhooks map[string]*PathItem `yaml:"webhooks,omitempty"`
1468
1469 // Components is an element to hold various schemas for the document.
1470 Components *Components `yaml:"components,omitempty"`
1471
1472 // Security is a declaration of which security mechanisms can be used across
1473 // the API. The list of values includes alternative security requirement
1474 // objects that can be used. Only one of the security requirement objects need
1475 // to be satisfied to authorize a request. Individual operations can override
1476 // this definition. To make security optional, an empty security requirement
1477 // ({}) can be included in the array.
1478 Security []map[string][]string `yaml:"security,omitempty"`
1479
1480 // Tags are a list of tags used by the document with additional metadata. The
1481 // order of the tags can be used to reflect on their order by the parsing
1482 // tools. Not all tags that are used by the Operation Object must be declared.
1483 // The tags that are not declared MAY be organized randomly or based on the
1484 // tools’ logic. Each tag name in the list MUST be unique.
1485 Tags []*Tag `yaml:"tags,omitempty"`
1486
1487 // ExternalDocs is additional external documentation.
1488 ExternalDocs *ExternalDocs `yaml:"externalDocs,omitempty"`
1489
1490 // Extensions (user-defined properties), if any. Values in this map will
1491 // be marshaled as siblings of the other properties above.
1492 Extensions map[string]any `yaml:",inline"`

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected