command

package
v0.0.0-...-82013dc Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandConvertToNDCSchema

func CommandConvertToNDCSchema(args *ConvertCommandArguments, logger *slog.Logger) error

ConvertToNDCSchema converts to NDC REST schema from file

func ConvertToNDCSchema

func ConvertToNDCSchema(config *configuration.ConvertConfig, logger *slog.Logger) (*schema.NDCRestSchema, error)

ConvertToNDCSchema converts to NDC REST schema from config

func Json2Yaml

func Json2Yaml(args *Json2YamlCommandArguments, logger *slog.Logger) error

Json2Yaml converts a JSON file to YAML

func ResolveConvertConfigArguments

func ResolveConvertConfigArguments(config *configuration.ConvertConfig, configDir string, args *ConvertCommandArguments)

ResolveConvertConfigArguments resolves convert config arguments

Types

type ConvertCommandArguments

type ConvertCommandArguments struct {
	File                string            `help:"File path needs to be converted."                                                     short:"f"`
	Config              string            `help:"Path of the config file."                                                             short:"c"`
	Output              string            `help:"The location where the ndc schema file will be generated. Print to stdout if not set" short:"o"`
	Spec                string            `help:"The API specification of the file, is one of oas3 (openapi3), oas2 (openapi2)"`
	Format              string            `` /* 222-byte string literal not displayed */
	Strict              bool              `default:"false"                                                                             help:"Require strict validation"`
	Pure                bool              `` /* 130-byte string literal not displayed */
	Prefix              string            `help:"Add a prefix to the function and procedure names"`
	TrimPrefix          string            `help:"Trim the prefix in URL, e.g. /v1"`
	EnvPrefix           string            `help:"The environment variable prefix for security values, e.g. PET_STORE"`
	MethodAlias         map[string]string `help:"Alias names for HTTP method. Used for prefix renaming, e.g. getUsers, postUser"`
	AllowedContentTypes []string          `help:"Allowed content types. All content types are allowed by default"`
	PatchBefore         []string          `help:"Patch files to be applied into the input file before converting"`
	PatchAfter          []string          `help:"Patch files to be applied into the input file after converting"`
}

ConvertCommandArguments represent available command arguments for the convert command

type Json2YamlCommandArguments

type Json2YamlCommandArguments struct {
	File   string `help:"File path needs to be converted. Print to stdout if not set" required:"" short:"f"`
	Output string `help:"The location where the ndc schema file will be generated"    short:"o"`
}

Json2YamlCommandArguments represent available command arguments for the json2yaml command

Jump to

Keyboard shortcuts

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