omc-college / management-system

1 stars 16 forks source link

To the folder where the code is generated #113

Closed TsybenkoMaria closed 4 years ago

TsybenkoMaria commented 4 years ago

Steps to reproduce: go run main.go --spec-path ~/go/src/github.com/omc-college/management-system/api/rbac/rbac-api.yaml --output-path ~/go/src/github.com/omc-college/management-system/pkg/models Current result: the result is written to a gofile named Models and only to those folders that have already been created Expected Result: The result is written to a gofile named Models and to any folder specified on the path. If the folder is missing, it is created and the result of code generation is written to it

TsybenkoMaria commented 4 years ago

Output-path is an argument that contains the path to the directory in which you want to create a file with the extension .go and in this file you need to write the generated code. The name of the file in which the generated code will be written will be called firstPartOfAPISPec.go where firstPartOfAPISPec is the first word in the name of the Open API specification. For example: for a specification called rbac-api.yaml the file in which the code will be generated should be called rbac.go