code: func (l *library) generate() error {
  	// write empty __init__.py in each dir
  	walkFn := func(path string, info os.FileInfo, err error) error {
  		if err != nil {
  			return err
  		}
  		if !info.IsDir() {
  			return nil
  		}
  		return generateEmptyInitPy(path)
  	}
  
  	if err := filepath.Walk(l.baseDir, walkFn); err != nil {
  		return err
  	}
  
  	// json schema
  	if err := generateJSONSchema(&raml.APIDefinition{
  		Types: l.Types,
  	}, l.dir); err != nil {
  		log.Errorf("failed to generate jsonschema:%v", err)
  		return err
  	}
  
  	// security schemes
  	if err := generateServerSecurity(l.SecuritySchemes, templates(serverKindFlask), l.dir); err != nil {
  		return err
  	}
  
  	// included libraries
  	for _, ramlLib := range l.Libraries {
  		childLib := newLibrary(ramlLib, l.baseDir)
  		if err := childLib.generate(); err != nil {
  			return err
  		}
  	}
  	return nil
  }
docs: // generate code of this library