diff --git a/api/generate.go b/api/generate.go index 707b7f620fe..5c3f5469d55 100644 --- a/api/generate.go +++ b/api/generate.go @@ -74,6 +74,10 @@ func Generate(cfg *config.Config, option ...Option) error { return errors.Wrap(err, "merging type systems failed") } + if err = codegen.GenerateCode(data); err != nil { + return errors.Wrap(err, "generating core failed") + } + for _, p := range plugins { if mut, ok := p.(plugin.CodeGenerator); ok { err := mut.GenerateCode(data) @@ -83,10 +87,6 @@ func Generate(cfg *config.Config, option ...Option) error { } } - if err = codegen.GenerateCode(data); err != nil { - return errors.Wrap(err, "generating core failed") - } - if !cfg.SkipValidation { if err := validate(cfg); err != nil { return errors.Wrap(err, "validation failed")