requestSchemas

package
v0.0.46 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

This package provides a standardized approach to handling request schemas

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeaderEntry added in v0.0.10

type HeaderEntry struct {
	Name        string `yaml:"name,omitempty" json:"name,omitempty"`
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	Required    bool   `yaml:"required,omitempty" json:"required,omitempty"`
}

type Schema

type Schema struct {
	RequestSchema struct {
		SchemaVersion string `yaml:"schemaVersion,omitempty" json:"schemaVersion,omitempty"`
		Categories    []struct {
			Name        string `yaml:"name,omitempty" json:"name,omitempty"`
			Description string `yaml:"description,omitempty" json:"description,omitempty"`
			Actions     []struct {
				Name               string   `yaml:"name,omitempty" json:"name,omitempty"`
				Body               bool     `yaml:"body,omitempty" json:"body,omitempty"`
				Method             string   `yaml:"method,omitempty" json:"method,omitempty"`
				Description        string   `yaml:"description,omitempty" json:"description,omitempty"`
				Parameters         []string `yaml:"parameters,omitempty" json:"parameters,omitempty"`
				OptionalParameters []string `yaml:"optionalParameters,omitempty" json:"optionalParameters,omitempty"`
				Headers            struct {
					Request  []HeaderEntry `yaml:"request,omitempty" json:"request,omitempty"`
					Response []HeaderEntry `yaml:"response,omitempty" json:"response,omitempty"`
				} `yaml:"headers"`
				Roles []string `yaml:"roles,omitempty" json:"roles,omitempty"`
			} `yaml:"actions,omitempty" json:"actions,omitempty"`
		} `yaml:"categories,omitempty" json:"categories,omitempty"`
	} `yaml:"requestSchema,omitempty" json:"requestSchema,omitempty"`
}

Struct to which the request schema configuration files should follow

func (*Schema) GetSchema

func (schema *Schema) GetSchema(requestSchemaData []byte) *Schema

GetSchema unmarshals the request schema data and returns a Schema struct

Jump to

Keyboard shortcuts

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