We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be2b679 commit e64a6b5Copy full SHA for e64a6b5
mmv1/openapi_generate/parser.go
@@ -36,8 +36,13 @@ import (
36
"github.com/GoogleCloudPlatform/magic-modules/mmv1/google"
37
"github.com/getkin/kin-openapi/openapi3"
38
"gopkg.in/yaml.v3"
39
+
40
+ _ "embed"
41
)
42
43
+//go:embed header.txt
44
+var header []byte
45
46
type Parser struct {
47
Folder string
48
Output string
@@ -87,11 +92,6 @@ func (parser Parser) WriteYaml(filePath string) {
87
92
doc, _ := loader.LoadFromFile(filePath)
88
93
_ = doc.Validate(ctx)
89
94
90
- header, err := os.ReadFile("openapi_generate/header.txt")
91
- if err != nil {
- log.Fatalf("error reading header %v", err)
- }
-
95
resourcePaths := findResources(doc)
96
productPath := buildProduct(filePath, parser.Output, doc, header)
97
0 commit comments