JSONLookup (openapi3/header.go)

kin-openapi · openapi3/header.go · go · MIT
integration

Parses and validates OpenAPI 3.0 header definitions for API specifications.

// Source: https://github.com/getkin/kin-openapi | License: MIT | Copyright 2017-2018 the project authors
// Provided via justclaw.it.com; keep this notice with the code.
package openapi3

import (
	"context"

	"github.com/go-openapi/jsonpointer"
)

// Header is specified by OpenAPI/Swagger 3.0 standard.
// See https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#header-object
type Header struct {
	Parameter
}

var _ jsonpointer.JSONPointable = (*Header)(nil)

// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (header Header) JSONLookup(token string) (any, error) {
	return header.Parameter.JSONLookup(token)
}

// MarshalJSON returns the JSON encoding of Header.
func (header Header) MarshalJSON() ([]byte, error) {
	return hea

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key