config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Path of this config
	FilePath string `json:"-"`

	// Extends file path
	ExtendsPath string `json:"extends"`

	// what version of config for oapi go should be used
	Version string `json:"version"`

	// what openapi version to produce
	OpenAPI string `json:"openapi"`

	// Format to produce
	Format string `json:"format"`

	// Directory to execute from
	Dir string `json:"dir"`

	// where to save, valid options should be stdout, stderr, file
	Output string `json:"output"`

	// go pkgs to exclude from scan
	Exclude []string `json:"exclude"`

	// Provides metadata about the API.
	// The metadata MAY be used by tooling as required.
	Info *spec.Info `json:"info"`

	// An array of Server Objects, which provide connectivity information to a target server.
	// If the servers property is not provided, or is an empty array, the default value would be a Server Object with a url value of /.
	Servers []*spec.Server `json:"servers"`

	// A declaration of which security mechanisms can be used across the API.
	// The list of values includes alternative security requirement objects that can be used.
	// Only one of the security requirement objects need to be satisfied to authorize a request.
	// Individual operations can override this definition.
	Security []map[string]spec.SecurityRequirement `json:"security"`

	// A list of tags used by the specification with additional metadata.
	// The order of the tags can be used to reflect on their order by the parsing tools.
	// Not all tags that are used by the Operation Object must be declared.
	// The tags that are not declared MAY be organized randomly or based on the tools' logic.
	// Each tag name in the list MUST be unique.
	Tags []*spec.Tag `json:"tags,omitempty"`

	// Additional external docs
	ExternalDocs *spec.ExternalDocumentation `json:"externalDocs"`

	// An element to hold various schemas for the specification.
	Components *spec.Components `json:"components,omitempty"`

	// types to override, key is pointer
	Overrides map[string]spec.Schema `json:"overrides"`

	// Operations are defaults for operations
	Operations map[string]spec.Operation `json:"operations"`
}

func ReadFile

func ReadFile(file string) (c Config, err error)

ReadFile ...

func ReadJSON

func ReadJSON(data []byte) (c Config, err error)

ReadJSON ...

func ReadYAML

func ReadYAML(data []byte) (c Config, err error)

ReadYAML ...

Jump to

Keyboard shortcuts

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