Files
libopenapi/datamodel/high/3.0/header.go
Dave Shanley 0c2c008902 Building out highlevel model
bit by bit, step by step.
2022-08-19 10:01:16 -04:00

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
}