apidiff

package
v0.21.4 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:          "apidiff [BASE_SPEC_AKITA_URI] [NEW_SPEC_AKITA_URI]",
	Short:        "Compare 2 API specs.",
	SilenceUsage: true,
	Args:         cobra.ExactArgs(2),
	RunE: func(cmd *cobra.Command, args []string) error {
		spec1, err := akiuri.Parse(args[0])
		if err != nil {
			return errors.Wrapf(err, "%q is not a well-formed AkitaURI", args[0])
		}

		spec2, err := akiuri.Parse(args[1])
		if err != nil {
			return errors.Wrapf(err, "%q is not a well-formed AkitaURI", args[1])
		}

		diffArgs := apidiff.Args{
			ClientID:    akiflag.GetClientID(),
			Domain:      akiflag.Domain,
			BaseSpecURI: spec1,
			NewSpecURI:  spec2,
			Out:         outFlag,
		}
		if err := apidiff.Run(diffArgs); err != nil {
			return cmderr.AkitaErr{Err: err}
		}

		return nil
	},
}

TODO(kku): support local specs by uploading them first.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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