    # File lib/chef/knife/cookbook_metadata.rb, line 92
          def validate_metadata_json(path, cookbook)
            json_file = File.join(path, cookbook, 'metadata.json')
            if File.exist?(json_file)
              Chef::Cookbook::Metadata.validate_json(IO.read(json_file))
            end
          rescue Exceptions::ObsoleteDependencySyntax, Exceptions::InvalidVersionConstraint => e
            ui.stderr.puts "ERROR: The cookbook '#{cookbook}' contains invalid or obsolete metadata syntax."
            ui.stderr.puts "in #{json_file}:"
            ui.stderr.puts
            ui.stderr.puts e.message
            exit 1
          end