app

package
v2.1.8 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RestCmd = &cobra.Command{
	Use:     "init",
	Version: fmt.Sprintf("swagr: 1.0 (powered by swag %s)", swag.Version),
	Short:   "Automatically generate RESTful API documentation with Swagger 2.0 and convert to openapi 3.0 (spec3) for Go. ",
	Example: "swagr init -g http/api.go",
	RunE: func(cmd *cobra.Command, args []string) (err error) {
		switch c.PropNamingStrategy {
		case swag.CamelCase, swag.SnakeCase, swag.PascalCase:
		default:
			return fmt.Errorf("not supported %s propertyStrategy", c.PropNamingStrategy)
		}

		return Build(&c)
	},
}

RestCmd represents the rest command

Functions

func Build

func Build(config *gen.Config) error

func BuildSwag

func BuildSwag(config *gen.Config) (s *spec.Swagger, err error)

func BuildV2

func BuildV2(config *gen.Config, s *spec.Swagger) (res []byte, err error)

func BuildV3

func BuildV3(config *gen.Config, swaggerV2 []byte) (res []byte, err error)

func OutPut

func OutPut(jsonBytes []byte, outputDir string, name string) error

func ReplaceSpot

func ReplaceSpot(searchIn []byte) (res []byte, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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