mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-10 04:20:24 +00:00
40 lines
904 B
Go
40 lines
904 B
Go
// Copyright 2022 Princess B33f Heavy Industries / Dave Shanley
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package v3
|
|
|
|
import low "github.com/pb33f/libopenapi/datamodel/low/3.0"
|
|
|
|
type Header struct {
|
|
Description string
|
|
Required bool
|
|
Deprecated bool
|
|
AllowEmptyValue bool
|
|
Style string
|
|
Explode bool
|
|
AllowReserved bool
|
|
Schema *Schema
|
|
Example any
|
|
Examples map[string]*Example
|
|
Content map[string]*MediaType
|
|
Extensions map[string]any
|
|
low *low.Header
|
|
}
|
|
|
|
func NewHeader(header *low.Header) *Header {
|
|
h := new(Header)
|
|
h.low = header
|
|
h.Description = header.Description.Value
|
|
h.Required = header.Required.Value
|
|
h.Deprecated = header.Deprecated.Value
|
|
h.AllowEmptyValue = header.AllowEmptyValue.Value
|
|
h.Style = header.Style.Value
|
|
|
|
// TODO continue this.
|
|
return h
|
|
}
|
|
|
|
func (h *Header) GoLow() *low.Header {
|
|
return h.low
|
|
}
|