Clever / wag

sWAGger - Web API Generator
Apache License 2.0
77 stars 6 forks source link

v4.0.0: import package with correct module version #307

Closed aastein closed 4 years ago

aastein commented 4 years ago

v4.0.0: import package with correct module version

new CLI flag: -output-path

assumptions: the code assumes it is being run in the same directory as the go.mod file

usage:

wag -output-path gen-go -js-path ./gen-js -file swagger.yml 

Changes to exported types, methods, and functions:

ghirsch1 commented 4 years ago

Can't we instead just generate everything from goPackagePath and the major version? Since it'll always be

tokens := strings.Split(goPackagePath, "/")
goPackageName := fmt.Sprintf("%v/%v/%v", tokens[:3], semverVersion.Major(), tokens[3:])

EDIT: Actually I guess that's just the standard way, but not technically a requirement for module naming, so never mind.

Some other minimal suggestions that maybe are nice?

johnhuangclever commented 4 years ago

Hey, do we need to update this as well? https://github.com/Clever/dev-handbook/blob/master/make/wag.mk And here? https://github.com/Clever/template-wag/commits/master/wag.mk

Not sure anymore how these versions get maintained