apidocs

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ResolveCmd = &cobra.Command{
		Use:                "resolve <space_delimited_source_files>",
		Short:              "Generate OAS3 document from contract definitions and external references",
		Example:            `lanai-cli apidocs resolve -O configs/api-docs.yaml -T $GITHUB_TOKEN -R https://api.swaggerhub.com/domains/<organization>/<project>/8=>github://github.com/raw/<organization>/<project>/<tag/branch>/common-domain-8.yaml contracts/service-8.yaml contracts/service-1.json`,
		FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true},
		Args:               ValidatePositionalArgs,
		RunE:               RunMerge,
	}
	ResolveArgs = ResolveArguments{
		Output:     "api-docs-merged.yaml",
		KeepExtRef: false,
	}
)
View Source
var (
	Cmd = &cobra.Command{
		Use:                "apidocs",
		Short:              "Utilities to work with OpenAPI Specs",
		FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true},
	}
)
View Source
var (
	ResolveConf = ResolveConfig{}
)

Functions

func RunMerge

func RunMerge(cmd *cobra.Command, args []string) error

func ValidatePositionalArgs

func ValidatePositionalArgs(_ *cobra.Command, args []string) error

Types

type ResolveArguments

type ResolveArguments struct {
	Output            string   `flag:"output-file,O" desc:"Path of output file, relative to working directory"`
	KeepExtRef        bool     `flag:"keep-external-ref,k" desc:"Keep external $ref as-is (skip resolving external $ref)"`
	ConfigPath        string   `` /* 244-byte string literal not displayed */
	GitHubPATs        []string `` /* 167-byte string literal not displayed */
	ReplaceExtSources []string `` /* 385-byte string literal not displayed */
}

type ResolveConfig

type ResolveConfig struct {
	GitHubTokens      []ResolveGitHubTokenMapping `json:"github-token"`
	ReplaceExtSources []ResolveExtSourceMapping   `json:"replace"`
}

type ResolveExtSourceMapping

type ResolveExtSourceMapping struct {
	Url string `json:"url"`
	To  string `json:"to"`
}

type ResolveGitHubTokenMapping

type ResolveGitHubTokenMapping struct {
	Host  string `json:"host"`
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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