apidiff

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Deprecated:   "Differences are now computed through the Akita app.",
	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:    telemetry.GetClientID(),
			Domain:      rest.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