@@ -309,7 +309,6 @@ func Load(configDetails types.ConfigDetails, options ...func(*Options)) (*types.
309309// LoadWithContext reads a ConfigDetails and returns a fully loaded configuration as a compose-go Project
310310func LoadWithContext (ctx context.Context , configDetails types.ConfigDetails , options ... func (* Options )) (* types.Project , error ) {
311311 opts := toOptions (& configDetails , options )
312-
313312 dict , err := loadModelWithContext (ctx , & configDetails , opts )
314313 if err != nil {
315314 return nil , err
@@ -359,11 +358,6 @@ func loadYamlModel(ctx context.Context, config types.ConfigDetails, opts *Option
359358 dict = map [string ]interface {}{}
360359 err error
361360 )
362- sch , err := schema .CreateComposeSchema ()
363- if err != nil {
364- return nil , fmt .Errorf ("could not initialise schema: %w" , err )
365- }
366-
367361 for _ , file := range config .ConfigFiles {
368362 fctx := context .WithValue (ctx , consts.ComposeFileKey {}, file .Filename )
369363 if file .Content == nil && file .Config == nil {
@@ -425,7 +419,7 @@ func loadYamlModel(ctx context.Context, config types.ConfigDetails, opts *Option
425419 }
426420
427421 if ! opts .SkipValidation {
428- if err := sch .Validate (dict ); err != nil {
422+ if err := schema .Validate (dict ); err != nil {
429423 return fmt .Errorf ("validating %s: %w" , file .Filename , err )
430424 }
431425 if _ , ok := dict ["version" ]; ok {
0 commit comments